Interface RolesManager
-
public interface RolesManager
Provides administrative (crud) roles management.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Role
addRole(Role roleTemplate)
Add a new role.boolean
deleteRole(String roleName)
Delete a role.Role
updateRole(Role roleTemplate)
Update a role.
-
-
-
Method Detail
-
addRole
Role addRole(Role roleTemplate) throws IllegalArgumentException, AccessDeniedException, RepositoryException
Add a new role.- Parameters:
roleTemplate
- A template for the role to create from, for example aRoleBean
instance- Returns:
- the created role (retrieved from the
RolesProvider
- Throws:
IllegalArgumentException
- when the role is null or roleTemplate.name is null/blankAccessDeniedException
- if not allowed to create a role, or trying to create a system role which is only allowed for system users:HippoSession.isSystemSession()
RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
updateRole
Role updateRole(Role roleTemplate) throws IllegalArgumentException, AccessDeniedException, RepositoryException
Update a role.- Parameters:
roleTemplate
- A template for the role to update from, for example aRoleBean
instance- Returns:
- the (possibly) updated role (retrieved from the
RolesProvider
- Throws:
IllegalArgumentException
- when the role is null or roleTemplate.name is null/blankAccessDeniedException
- if not allowed to set the system status, or change a system role, which is only allowed for system users:HippoSession.isSystemSession()
RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
deleteRole
boolean deleteRole(String roleName) throws IllegalArgumentException, AccessDeniedException, RepositoryException
Delete a role.- Parameters:
roleName
- The name of the role to delete- Returns:
- true if the role was deleted; false if the role didn't exist (anymore)
- Throws:
IllegalArgumentException
- when the roleName is null/blankAccessDeniedException
- if not allowed to delete a system role which is only allowed for system users:HippoSession.isSystemSession()
RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrong
-
-