Interface RolesManager
public interface RolesManager
Provides administrative (crud) roles management.
-
Method Summary
Modifier and TypeMethodDescriptionAdd a new role.boolean
deleteRole
(String roleName) Delete a role.updateRole
(Role roleTemplate) Update a role.
-
Method Details
-
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
-