Interface RolesHolder
-
- All Superinterfaces:
Loggable
- All Known Subinterfaces:
RolesHolderEx
,SUser
,SUserGroup
,UserEx
,UserGroupEx
- All Known Implementing Classes:
AllUsersGroup
,AssociatedUser
,BaseUser
,InMemoryUser
,RestrictedUserImpl
,RolesHolderImpl
,SecuredUser
,SecuredUserGroup
,TestUser
,UserGroupImpl
,UserImpl
public interface RolesHolder extends Loggable
Roles container
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addRole(RoleScope scope, Role role)
Adds role with specified scopeCollection<RolesHolder>
getAllParentHolders()
Returns all parent holders including transitive onesCollection<RolesHolder>
getParentHolders()
Returns direct (non transitive) parent holders.Collection<RoleEntry>
getRoles()
Returns roles with their scopesCollection<Role>
getRolesWithScope(RoleScope scope)
Returns all roles with specified scope.Collection<RoleScope>
getScopes()
Returns all scopes with assigned rolesboolean
isSystemAdministratorRoleGranted()
Returns true if this roles holder contains system administrator role granted directly or inherited via parent holders.boolean
isSystemAdministratorRoleGrantedDirectly()
Returns true if this roles holder contains system administrator role granted directly.boolean
isSystemAdministratorRoleInherited()
Returns true if one of the parents (transitively) of this roles holder contains system administrator role.void
removeRole(Role role)
Removes specified role.void
removeRole(RoleScope scope, Role role)
Removes role with specified scopevoid
removeRoles(RoleScope scope)
Removes all of the roles having the specified scope.
-
-
-
Method Detail
-
getRolesWithScope
@NotNull Collection<Role> getRolesWithScope(@NotNull RoleScope scope)
Returns all roles with specified scope.- Parameters:
scope
- roles scope- Returns:
- all roles with specified scope.
-
getScopes
Collection<RoleScope> getScopes()
Returns all scopes with assigned roles- Returns:
- all scopes with assigned roles
-
getRoles
@NotNull Collection<RoleEntry> getRoles()
Returns roles with their scopes- Returns:
- roles with their scopes
-
addRole
void addRole(@NotNull RoleScope scope, @NotNull Role role)
Adds role with specified scope- Parameters:
scope
- scope of the rolerole
- role
-
removeRole
void removeRole(@NotNull RoleScope scope, @NotNull Role role)
Removes role with specified scope- Parameters:
scope
- scope of the rolerole
- role
-
removeRole
void removeRole(@NotNull Role role)
Removes specified role. If the role is associated with several scopes all of these roles will be removed.- Parameters:
role
- role to remove
-
removeRoles
void removeRoles(@NotNull RoleScope scope)
Removes all of the roles having the specified scope.- Parameters:
scope
- scope of the role
-
isSystemAdministratorRoleGranted
boolean isSystemAdministratorRoleGranted()
Returns true if this roles holder contains system administrator role granted directly or inherited via parent holders. Same as:isSystemAdministratorRoleGrantedDirectly() || isSystemAdministratorRoleInherited()
- Returns:
- see above.
-
isSystemAdministratorRoleGrantedDirectly
boolean isSystemAdministratorRoleGrantedDirectly()
Returns true if this roles holder contains system administrator role granted directly.- Returns:
- see above.
-
isSystemAdministratorRoleInherited
boolean isSystemAdministratorRoleInherited()
Returns true if one of the parents (transitively) of this roles holder contains system administrator role.- Returns:
- see above
-
getParentHolders
@NotNull Collection<RolesHolder> getParentHolders()
Returns direct (non transitive) parent holders.- Returns:
- parent holders
-
getAllParentHolders
@NotNull Collection<RolesHolder> getAllParentHolders()
Returns all parent holders including transitive ones- Returns:
- all parent holders
-
-