Interface RolesManager
-
- All Known Implementing Classes:
RolesManagerImpl
public interface RolesManagerMaintains a group of roles currently defined in the system
-
-
Field Summary
Fields Modifier and Type Field Description static StringSUPER_USER_ROLE_IDId of the super user role.static StringSYS_ADMIN_ROLE_IDId of the system administrator role.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddRoleListener(RoleListener listener)Adds listener to the managerRolecreateNewRole(String roleName)Creates new role with given id and namevoiddeleteRole(Role role)Deletes roleRolefindRoleById(String roleId)Searches for a role with specified idCollection<? extends Role>getAllIncludedRoles(Role role)Collects all roles recursively inlcuded in the roleList<Role>getAvailableRoles()Returns list of roles configured in the system.Map<String,Role>getAvailableRolesMap()Same asgetAvailableRoles()but returns map where id of the role is a key.RolegetSuperUserRole()Returns predefined non configurable role representing super user.RolegetSystemAdministratorRole()Returns predefined non configurable role representing system administrator.voidremoveRoleListener(RoleListener listener)Removes listener to the manager
-
-
-
Field Detail
-
SYS_ADMIN_ROLE_ID
static final String SYS_ADMIN_ROLE_ID
Id of the system administrator role.- See Also:
- Constant Field Values
-
SUPER_USER_ROLE_ID
static final String SUPER_USER_ROLE_ID
Id of the super user role.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAvailableRoles
@NotNull List<Role> getAvailableRoles()
Returns list of roles configured in the system.- Returns:
- list of roles configured in the system.
-
getAvailableRolesMap
@NotNull Map<String,Role> getAvailableRolesMap()
Same asgetAvailableRoles()but returns map where id of the role is a key.- Returns:
- map of roles
-
findRoleById
@Nullable Role findRoleById(@NotNull String roleId)
Searches for a role with specified id- Parameters:
roleId- id of the role- Returns:
- role with specified id or null
-
getSystemAdministratorRole
@NotNull Role getSystemAdministratorRole()
Returns predefined non configurable role representing system administrator. This role contains all of the permissions allowed in the server and it cannot be associated with a project.- Returns:
- system administrator role, never null
-
getSuperUserRole
@NotNull Role getSuperUserRole()
Returns predefined non configurable role representing super user. This role contains all of the permissions and it cannot be associated with a project.- Returns:
- super user role, never null
- Since:
- 2020.2
-
deleteRole
void deleteRole(@NotNull Role role)Deletes role- Parameters:
role- role to be deleted
-
createNewRole
Role createNewRole(@NotNull String roleName) throws DuplicateRoleException, InvalidRoleNameException
Creates new role with given id and name- Parameters:
roleName- name- Returns:
- the created role
- Throws:
DuplicateRoleException- if a roleroleNamealready existsInvalidRoleNameException- ifroleNamecannot be name for a role
-
getAllIncludedRoles
Collection<? extends Role> getAllIncludedRoles(@NotNull Role role)
Collects all roles recursively inlcuded in the role- Parameters:
role- role- Returns:
- all roles included in the role
-
addRoleListener
void addRoleListener(@NotNull RoleListener listener)Adds listener to the manager- Parameters:
listener- listener to add
-
removeRoleListener
void removeRoleListener(@NotNull RoleListener listener)Removes listener to the manager- Parameters:
listener- listener to remove
-
-