Interface RoleManager
- All Known Implementing Classes:
FileRoleManager
public interface RoleManager
The main interface for managing role details.
- Since:
- 7.0.1
- Author:
- Moran Avigdor
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateRole(RoleDetails roleDetails) Create a new role with the specifiedroleDetails.voiddeleteRole(String role) Delete an existing role represented by the specifiedrole.Retrieve the role details byrole.booleanIndicates that this manager is for read-only purposes, and that any invocation of a destructive operation will throw anAccessDeniedException.mapRoles()Returns a map containing mapping between role and role-details.booleanroleExists(String role) Queries for presence of a role by role.voidupdateRole(RoleDetails roleDetails) Updates the role details, excluding the role which must remain the same.
-
Method Details
-
isReadOnly
boolean isReadOnly()Indicates that this manager is for read-only purposes, and that any invocation of a destructive operation will throw anAccessDeniedException.- Returns:
trueif read-only access is allowed.
-
createRole
void createRole(RoleDetails roleDetails) throws RoleAlreadyExistsException, RoleDataAccessException, AccessDeniedException Create a new role with the specifiedroleDetails.- Parameters:
roleDetails- new role details to store.- Throws:
RoleAlreadyExistsException- if the role details represent a non-unique roleRoleDataAccessException- if could not store the specified role details.AccessDeniedException- if read-only access is allowed.
-
deleteRole
void deleteRole(String role) throws RoleNotFoundException, RoleDataAccessException, AccessDeniedException Delete an existing role represented by the specifiedrole.- Parameters:
role- an existing role name.- Throws:
RoleNotFoundException- if the role was not found.RoleDataAccessException- if could not delete the specified role details.AccessDeniedException- if read-only access is allowed.
-
getRole
Retrieve the role details byrole.- Parameters:
role- an existing role to retrieve.- Returns:
- the role details of the specified role.
- Throws:
RoleNotFoundException- if the role was not found.RoleDataAccessException- if could not retrieve the specified role details.
-
mapRoles
Returns a map containing mapping between role and role-details.- Returns:
- a mapping between role name and role-details.
- Throws:
RoleDataAccessException- if could not retrieve role-details to map.
-
updateRole
void updateRole(RoleDetails roleDetails) throws RoleNotFoundException, RoleDataAccessException, AccessDeniedException Updates the role details, excluding the role which must remain the same. In order to update a role, a role must be removed and re-created.- Parameters:
roleDetails- the role details to update.- Throws:
RoleNotFoundException- if the role was not found.RoleDataAccessException- if could not update the role details.AccessDeniedException- if read-only access is allowed.
-
roleExists
Queries for presence of a role by role.- Parameters:
role- the role to check existence for.- Returns:
trueif the role exists;falseotherwise.- Throws:
RoleDataAccessException- if could not query for the specified role.
-