Role objects,
which can be used for authentication and authorization purposes.
This version of the User Admin service defines two types of Role
objects: "User" and "Group". Each type of role is represented by an
int constant and an interface. The range of positive integers is
reserved for new types of roles that may be added in the future. When
defining proprietary role types, negative constant values must be used.
Every role has a name and a type.
A User object can be configured with credentials (e.g., a password)
and properties (e.g., a street address, phone number, etc.).
A Group object represents an aggregation of User and
Group objects. In other words, the members of a Group object
are roles themselves.
Every User Admin service manages and maintains its own namespace of
Role objects, in which each Role object has a unique name.
| Modifier and Type | Method and Description |
|---|---|
| public Role | Returns: The newly createdRole object, or null if a role
with the given name already exists.The name, int type)name of the Role object to create.Creates a |
| public Authorization | Returns: theAuthorization object for the specified User
object.The user)User object to create an Authorization
object for, or null for the anonymous user.Creates an |
| public Role | |
| public Role[] | Returns: TheRole objects managed by this User Admin service whose
properties match the specified filter criteria, or all
Role objects if a null filter is specified. If no
roles match the filter, null will be returned.The filter criteria to match. filter)Gets the |
| public User | Returns: A matching user, if exactly one is found. If zero or more than one matching users are found,null is returned.The property key to look for. key, String The property value to compare with. value)Gets the user with the given property |
| public boolean | Returns: true If a Role object with the given name is
present in this User Admin service and could be removed,
otherwise false.The name of the name)Role object to remove.Removes the |
| createRole | back to summary |
|---|---|
| public Role createRole(String name, int type) Creates a
If a
| |
| getAuthorization | back to summary |
|---|---|
| public Authorization getAuthorization(User user) Creates an
| |
| getRole | back to summary |
|---|---|
| public Role getRole(String name) Gets the | |
| getRoles | back to summary |
|---|---|
| public Role[] getRoles(String filter) throws InvalidSyntaxException Gets the
| |
| getUser | back to summary |
|---|---|
| public User getUser(String key, String value) Gets the user with the given property | |
| removeRole | back to summary |
|---|---|
| public boolean removeRole(String name) Removes the
If the
| |