|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.sconman.PermissionAggregator net.sourceforge.sconman.User
public class User
User class represent actors that access a Project
and performs
operations on it. In order to get a valid user, call
SecurityContext.loginUser(String,String)
to log in the system.
Field Summary | |
---|---|
(package private) static java.lang.String |
EMAIL
First name field |
(package private) static java.lang.String |
FIRST_NAME
First name field |
(package private) static java.lang.String |
LAST_NAME
First name field |
(package private) static java.lang.String |
LOGIN
Login field |
(package private) static java.lang.String |
PASSWORD
Password field |
(package private) static java.lang.String |
PERMISSIONS
First name field |
(package private) static java.lang.String |
ROLES
First name field |
static java.lang.String |
USER_CTYPE
Content type associated to users |
static java.lang.String |
USERS_CATEGORY
Category associated to users; |
Fields inherited from class net.sourceforge.sconman.PermissionAggregator |
---|
permissions, sctx |
Constructor Summary | |
---|---|
User(SecurityContext sctx,
Content content)
Main constructor |
Method Summary | |
---|---|
void |
addRelatedContent(Content content)
This methods adds a related content to the User |
(package private) void |
addRole(Role role)
Adds a role to the user |
(package private) void |
addRole(java.lang.String role)
Adds a role to the user, known its identifier |
void |
addRole(User actor,
Role role)
Adds a role to the user |
void |
addRole(User actor,
java.lang.String role)
Adds a role to the user, known its identifier |
(package private) void |
addRoles(java.lang.String roles)
Adds a role list to the user, given a CSV String of role identifiers |
void |
changePassword(User actor,
java.lang.String newPassword)
Use this method to change password. |
(package private) java.util.List |
getAllPermissions()
Returns all the user permissions |
Content |
getContent()
Returns the wrapped content |
java.util.List |
getContentsRelatedToContent(User user,
boolean visible)
Returns all the contents who are related to this User |
java.lang.String |
getEmail()
Returns the user email |
java.lang.String |
getFirstName()
Returns the user first id |
java.lang.String |
getId()
Returns the user's identifier |
java.lang.String |
getLastName()
Returns the user last id |
java.lang.String |
getLogin()
Returns the user's login |
Project |
getProject()
Returns the user's project |
java.lang.String |
getProperty(java.lang.String name)
Returns a user property value |
java.util.List |
getReferencingContents(User user,
java.lang.String ctype,
java.lang.String fieldName,
boolean visible)
Returns the contents of a given type that reference this User in the specified field. |
java.util.List |
getRelatedContents(User user,
boolean visible)
Returns all the contents related for this User |
java.util.List |
getRoles()
Return the user role list |
java.lang.String |
getRolesAsString()
Returns the user's role list as a String |
java.util.List |
getSubscriptions()
Returns the list of subscriptions (a list of Subscription ) |
boolean |
hasAddNewPermission(ContentType ctype)
Checks whether the aggregator can create new contents of the given type |
boolean |
hasAdminProjectPermission()
Checks that the user can manage the project (Manage Roles and Users) |
boolean |
hasDeletePermission(Category cat)
Checks whether the aggregator can remove a category |
boolean |
hasDeletePermission(ContentType ctype)
Checks whether the aggregator can delete that content type |
boolean |
hasModifyPermission(Category cat)
Checks whether the aggregator can modify a category |
boolean |
hasModifyPermission(ContentType ctype)
Checks whether the aggregator can modify that content type |
(package private) boolean |
hasPermission(Permission permission)
Checks whether the user has a permission or not |
boolean |
hasRole(Role role)
Checks that the user has a role |
boolean |
hasRole(java.lang.String role)
Checks that the user has a role |
boolean |
hasViewPermission(Category cat)
Checks whether the aggregator can view a category |
boolean |
hasViewPermission(ContentType ctype)
Checks whether the aggregator can view that content type |
void |
remove(User actor)
Revome the user |
void |
removeRelatedContent(Content relatedContent)
Removes a related content to the User |
(package private) void |
removeRole(Role role)
Removes a role from the user |
(package private) void |
removeRole(java.lang.String role)
Removes a user's role |
void |
removeRole(User actor,
Role role)
Removes a role from the user |
void |
removeRole(User actor,
java.lang.String role)
Removes a role from the user, known its identifier |
void |
save()
Saves the user info |
void |
save(User actor)
Saves the user info |
void |
setEmail(java.lang.String email)
Sets the user email |
void |
setFirstName(java.lang.String name)
Sets the user first id |
void |
setLastName(java.lang.String lastName)
Sets the user last id |
(package private) void |
setLogin(java.lang.String login)
Sets the user login |
(package private) void |
setPassword(java.lang.String password)
Sets the user password |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a user property |
java.lang.String |
toString()
String representation of a User object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USER_CTYPE
public static final java.lang.String USERS_CATEGORY
static final java.lang.String LOGIN
static final java.lang.String PASSWORD
static final java.lang.String FIRST_NAME
static final java.lang.String LAST_NAME
static final java.lang.String EMAIL
static final java.lang.String ROLES
static final java.lang.String PERMISSIONS
Constructor Detail |
---|
User(SecurityContext sctx, Content content)
sctx
- The parent scurity contextid
- The user identifierMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public Project getProject()
public Content getContent()
public java.lang.String getId()
void setLogin(java.lang.String login)
login
- void setPassword(java.lang.String password)
password
- public void setFirstName(java.lang.String name)
firstName
- public java.lang.String getLogin()
public java.lang.String getFirstName()
public java.lang.String getLastName()
public void setLastName(java.lang.String lastName)
lastName
- The last id to setpublic java.lang.String getEmail()
public void setEmail(java.lang.String email)
email
- The new user email addressvoid addRole(Role role)
role
- The role to addvoid addRole(java.lang.String role)
role
- The role identifiervoid addRoles(java.lang.String roles)
roles
- A CSV String of role identifierspublic void addRole(User actor, java.lang.String role) throws SCMSecurityException
actor
- The User who adds the Rolerole
- The role identifier
SCMSecurityException
public void addRole(User actor, Role role) throws SCMSecurityException
actor
- The User who adds the Rolerole
- The role to add
SCMSecurityException
void removeRole(Role role)
role
- The role to removevoid removeRole(java.lang.String role)
role
- The role identifierpublic void removeRole(User actor, Role role) throws SCMSecurityException
actor
- The User who removes the Rolerole
- The role to remove
SCMSecurityException
public void removeRole(User actor, java.lang.String role) throws SCMSecurityException
actor
- The User who removes the Rolerole
- The role identifier
SCMSecurityException
public boolean hasRole(java.lang.String role)
role
- The role identifier
public boolean hasRole(Role role)
role
- The role
public java.util.List getRoles()
java.util.List getAllPermissions()
boolean hasPermission(Permission permission)
hasPermission
in class PermissionAggregator
permission
- The permission to check
public java.lang.String getRolesAsString()
public void save() throws SCMStorageException
actor
- The user that saves
SCMSecurityException
- If the actor cannot save the user
SCMStorageException
public void save(User actor) throws SCMStorageException, SCMSecurityException
actor
- The user that saves
SCMSecurityException
- If the actor cannot save the user
SCMStorageException
public void changePassword(User actor, java.lang.String newPassword) throws SCMSecurityException
actor
- newPassword
-
SCMSecurityException
public void setProperty(java.lang.String name, java.lang.String value)
name
- The property namevalue
- The property valuepublic java.lang.String getProperty(java.lang.String name)
name
- The property name
public void remove(User actor) throws SCMException
actor
- User that removes the user
SCMException
public java.util.List getSubscriptions() throws SCMStorageException
Subscription
)
SCMStorageException
public void addRelatedContent(Content content) throws SCMStorageException
content
-
SCMStorageException
public void removeRelatedContent(Content relatedContent) throws SCMStorageException
relatedContent
-
SCMStorageException
public java.util.List getReferencingContents(User user, java.lang.String ctype, java.lang.String fieldName, boolean visible) throws java.io.IOException, SCMException
ctype
- The type of the requested contentsfieldName
- The field id that references this content's typevisible
- True to filter non visible contents
java.io.IOException
- If there's an IO problem
SCMException
public java.util.List getRelatedContents(User user, boolean visible) throws SCMStorageException, SCMSecurityException
user
- The user who requests the related contents
SCMStorageException
SCMSecurityException
public java.util.List getContentsRelatedToContent(User user, boolean visible) throws SCMStorageException, SCMSecurityException
user
- The user who requests the related contents
SCMStorageException
SCMSecurityException
public boolean hasAddNewPermission(ContentType ctype)
PermissionAggregator
hasAddNewPermission
in class PermissionAggregator
public boolean hasAdminProjectPermission()
PermissionAggregator
hasAdminProjectPermission
in class PermissionAggregator
public boolean hasDeletePermission(Category cat)
PermissionAggregator
hasDeletePermission
in class PermissionAggregator
public boolean hasDeletePermission(ContentType ctype)
PermissionAggregator
hasDeletePermission
in class PermissionAggregator
public boolean hasModifyPermission(Category cat)
PermissionAggregator
hasModifyPermission
in class PermissionAggregator
public boolean hasModifyPermission(ContentType ctype)
PermissionAggregator
hasModifyPermission
in class PermissionAggregator
public boolean hasViewPermission(Category cat)
PermissionAggregator
hasViewPermission
in class PermissionAggregator
public boolean hasViewPermission(ContentType ctype)
PermissionAggregator
hasViewPermission
in class PermissionAggregator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |