Class User
java.lang.Object
org.dlese.dpc.schemedit.security.user.User
Class that represents a registered DCS User, including attributes, roles and
preferences.
Note: passwords are not stored with the User objects.
- Author:
- ostwald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontrols(Roles.Role role, String collection) Does this user have a role higher than the provided for the specified collectionvoiddeletePref(String name) Delete a rref (if the collection is not the default collection)voiddeleteRole(String collection) Delete a role (if the collection is not the default collection)voiddestroy()Destroy the datastructures for this User objectvoidflush()Write this User to disk and reset data structures so they will be reloaded from disk.getAssignedRole(String collection) Return the role that has been explicitly assigned to the specified collection.Gets the department attribute of the User objectgetEmail()Return the from address.Gets the firstName attribute of the User objectGets the fullName attribute of the User objectGets the institution attribute of the User objectbooleanReturns true of this user is an adminGets the lastName attribute of the User objectGets the maxRole attribute of the User objectGets the pref attribute of the User objectGets the roleMap attribute of the User objectGets the effective role for this collection, meaning if there is no explicit role assigned, use the default.Gets the roleMap attribute of the User objectGets the file for this user objectReturn the username.booleanNOT YET DOCUMENTEDbooleanReturns true if this User has a role statisfying provided Role in the specified collection.booleanhasRole(Roles.Role role) Returns true if this User has a role statisfying provided Role in any collection.booleanhasRole(Roles.Role role, String collection) Returns true if this User has at least the specified role in the specified collectionbooleanReturns true of this user is an adminstatic voidThe main program for the User classNOT YET DOCUMENTEDprotected static voidNOT YET DOCUMENTEDvoidsetAdminUser(boolean isAdmin) Sets the adminUser attribute of the User objectvoidsetDepartment(String department) Sets the department attribute of the User objectvoidSet the from address.voidsetFirstName(String firstName) Sets the firstName attribute of the User objectvoidsetInstitution(String institution) Sets the institution attribute of the User objectvoidsetLastName(String lastName) Sets the lastName attribute of the User objectvoidSet the User's rref for specified collection.voidsetRole(String collection, Roles.Role role) Set the User's role for specified collection.voidSets the file path for this object (where it is flushed).voidsetUsername(String username) Set the username.toString()NOT YET DOCUMENTED
-
Constructor Details
-
Method Details
-
getSource
Gets the file for this user object- Returns:
- The source value
-
setSource
Sets the file path for this object (where it is flushed).- Parameters:
file- The new source value
-
getUsername
Return the username.- Returns:
- The username value
-
setUsername
Set the username.- Parameters:
username- The new username
-
getEmail
Return the from address.- Returns:
- The email value
-
setEmail
Set the from address.- Parameters:
email- The new from address
-
getFirstName
Gets the firstName attribute of the User object- Returns:
- The firstName value
-
setFirstName
Sets the firstName attribute of the User object- Parameters:
firstName- The new firstName value
-
getLastName
Gets the lastName attribute of the User object- Returns:
- The lastName value
-
setLastName
Sets the lastName attribute of the User object- Parameters:
lastName- The new lastName value
-
getFullName
Gets the fullName attribute of the User object- Returns:
- The fullName value
-
getInstitution
Gets the institution attribute of the User object- Returns:
- The institution value
-
setInstitution
Sets the institution attribute of the User object- Parameters:
institution- The new institution value
-
getDepartment
Gets the department attribute of the User object- Returns:
- The department value
-
setDepartment
Sets the department attribute of the User object- Parameters:
department- The new department value
-
getPrefMap
Gets the roleMap attribute of the User object- Returns:
- The prefMap value
-
getPref
Gets the pref attribute of the User object- Parameters:
prefname- Description of the Parameter- Returns:
- The pref value
-
setPref
Set the User's rref for specified collection.If the rref to set is the same as the User's default rref, then delete the rref for the specified collection (effectively setting it, since calls to getPref for that collection will return the default rref).
- Parameters:
name- The new pref valueval- The new pref value
-
deletePref
Delete a rref (if the collection is not the default collection)- Parameters:
name- Description of the Parameter
-
getMaxRole
Gets the maxRole attribute of the User object- Returns:
- The maxRole value
-
getAssignedRole
Return the role that has been explicitly assigned to the specified collection. Returns null if there is no assignment.- Parameters:
collection- NOT YET DOCUMENTED- Returns:
- The assignedRole value
-
getRole
Gets the effective role for this collection, meaning if there is no explicit role assigned, use the default.- Parameters:
collection- the collection- Returns:
- The role value
-
hasRole
NOT YET DOCUMENTED- Parameters:
roleStr- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
hasRole
Returns true if this User has a role statisfying provided Role in the specified collection.- Parameters:
roleStr- specified role (as string)collection- the collection- Returns:
- true if the user has permission for this collection
-
hasRole
Returns true if this User has a role statisfying provided Role in any collection.- Parameters:
role- specified role- Returns:
- true if this User has a role statisfying provided Role in any collection
-
hasRole
Returns true if this User has at least the specified role in the specified collection- Parameters:
role- the rolecollection- the collection- Returns:
- NOT YET DOCUMENTED
-
setAdminUser
public void setAdminUser(boolean isAdmin) Sets the adminUser attribute of the User object- Parameters:
isAdmin- The new adminUser value
-
isAdminUser
public boolean isAdminUser()Returns true of this user is an admin- Returns:
- The adminUser value
-
getIsAdminUser
public boolean getIsAdminUser()Returns true of this user is an admin- Returns:
- The isAdminUser value
-
controls
Does this user have a role higher than the provided for the specified collection- Parameters:
role- NOT YET DOCUMENTEDcollection- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
setRole
Set the User's role for specified collection.If the role to set is the same as the User's default role, then delete the role for the specified collection (effectively setting it, since calls to getRole for that collection will return the default role).
- Parameters:
collection- The new role valuerole- The new role value
-
deleteRole
Delete a role (if the collection is not the default collection)- Parameters:
collection- NOT YET DOCUMENTED
-
getRoleMap
Gets the roleMap attribute of the User object- Returns:
- The roleMap value
-
nonNullValue
NOT YET DOCUMENTED- Parameters:
s- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
toString
NOT YET DOCUMENTED -
flush
Write this User to disk and reset data structures so they will be reloaded from disk.- Throws:
Exception- Description of the Exception
-
destroy
public void destroy()Destroy the datastructures for this User object -
main
The main program for the User class- Parameters:
args- The command line arguments- Throws:
Exception- Description of the Exception
-
prtln
NOT YET DOCUMENTED- Parameters:
s- NOT YET DOCUMENTED
-