|
Jive Forums API (5.5.20.2-oracle) Core Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface User
The User interface provides information about and services for users of the system. Users can be identified by a unique id or username. Users can also be organized into groups for easier management of permissions.
The name and email field will normally be required fields when creating user accounts for most implementations. However, some users may wish to keep that information private. Therefore, there are two flags to set if the name and email fields should be made visible to other users. If the flags are set to deny access, getName() and getEmail() will throw UnauthorizedExceptions to users that don't have administrator permissions.
Security for User objects is provide by UserProxy protection proxy objects.
Instructions for those that wish to implement this interface to provide a custom User implementation appear in red.
Group
Method Summary | |
---|---|
void |
deleteProperty(java.lang.String name)
Deletes an extended property. |
java.util.Date |
getCreationDate()
Returns the date that the user was created. |
java.lang.String |
getEmail()
Returns the user's email address. |
long |
getID()
Returns the user's id. |
java.util.Date |
getModificationDate()
Returns the date that the user was last modified. |
java.lang.String |
getName()
Returns the user's name. |
java.lang.String |
getPasswordHash()
Returns the user's password in hashed form. |
Permissions |
getPermissions(AuthToken authToken)
Returns the permissions for the user that correspond to the passed-in AuthToken. |
java.lang.String |
getProperty(java.lang.String name)
Returns an extended property of the user. |
java.util.Iterator |
getPropertyNames()
Returns an Iterator for all the names of the extended user properties. |
java.lang.String |
getUsername()
Returns the user's username. |
boolean |
isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. |
boolean |
isEmailVisible()
Returns true if the user has chosen to make her email visible to other users. |
boolean |
isNameVisible()
Returns true if the user has chosen to make her name visible to other users. |
void |
setCreationDate(java.util.Date creationDate)
Sets the creation date of the user. |
void |
setEmail(java.lang.String email)
Sets the user's email address. |
void |
setEmailVisible(boolean visible)
Sets whether a user's email is visible to other users. |
void |
setModificationDate(java.util.Date modificationDate)
Sets the date the user was last modified. |
void |
setName(java.lang.String name)
Sets the user's name. |
void |
setNameVisible(boolean visible)
Sets whether a user's name is visible to other users. |
void |
setPassword(java.lang.String password)
Sets the users's password. |
void |
setPasswordHash(java.lang.String passwordHash)
Sets the user's password in hashed form. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets an extended property of the user. |
Method Detail |
---|
long getID()
java.lang.String getUsername()
java.lang.String getName()
void setName(java.lang.String name) throws UnauthorizedException
name
- new name for the user.
UnauthorizedException
- if does not have administrator permissions.boolean isNameVisible()
void setNameVisible(boolean visible) throws UnauthorizedException
visible
- boolean value to determin if the name should be visible.
UnauthorizedException
- if does not have administrator permissions.void setPassword(java.lang.String password) throws UnauthorizedException
password
- new password for the user.
UnauthorizedException
- if does not have administrator permissions.java.lang.String getPasswordHash() throws UnauthorizedException
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
UnauthorizedException
- if does not have administrator permissions.void setPasswordHash(java.lang.String passwordHash) throws UnauthorizedException
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
passwordHash
- the hashedPassword for the user.
UnauthorizedException
- if does not have administrator permissions.java.lang.String getEmail()
If your back-end user store does not support this operation, always return null.
void setEmail(java.lang.String email) throws UnauthorizedException
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
email
- new email address for the user.
UnauthorizedException
- if does not have administrator permissions.boolean isEmailVisible()
void setEmailVisible(boolean visible) throws UnauthorizedException
visible
- boolean value to determin if the name should be visible.
UnauthorizedException
- if does not have administrator permissions.java.util.Date getCreationDate()
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
void setCreationDate(java.util.Date creationDate) throws UnauthorizedException
creationDate
- the date the user was created.
UnauthorizedException
- if does not have administrator permissions.java.util.Date getModificationDate()
void setModificationDate(java.util.Date modificationDate) throws UnauthorizedException
modificationDate
- the date the user was modified.
UnauthorizedException
- if does not have administrator permissions.java.lang.String getProperty(java.lang.String name)
name
- the name of the property to get.
void setProperty(java.lang.String name, java.lang.String value) throws UnauthorizedException
name
- the name of the property to set.value
- the new value for the property.
UnauthorizedException
- if not allowed to edit.void deleteProperty(java.lang.String name) throws UnauthorizedException
name
does not exist,
this method will do nothing.
name
- the name of the property to delete.
UnauthorizedException
- if not allowed to edit.java.util.Iterator getPropertyNames()
This method should typically be implemented as:
if (auth.getUserID() == id) {
return new Permissions(Permissions.USER_ADMIN);
}
else {
return new Permissions(Permissions.NONE);
}
Permissions getPermissions(AuthToken authToken)
authToken
- the auth token to look up permissions with.boolean isAuthorized(long permissionType)
Because proxy objects will implement real security checking, this
method should be implemented as:
return true;.
permissionType
- the permission to check for.Permissions
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |