Interface RoleCollection
@ProviderType
public interface RoleCollection
Represents a managed collection of role IDs, starting with the
initial set calculated from persisted role assignment and role
inheritance. The roles can be contributed via
RoleContributor.contribute(RoleCollection)
.- Author:
- Carlos Sierra Andrés, Raymond Augé
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addRoleId
(long roleId) Adds the role ID to the collection.long
Returns the primary key of the company whose permissions are being checked.long
Returns the primary key of the group whose permissions are being checked.long[]
Returns the IDs of the initial set of roles calculated from persisted assignment and inheritance.getUser()
boolean
hasRoleId
(long roleId) Returnstrue
if the collection has the role ID.boolean
Returnstrue
if the user is signed in.boolean
removeRoleId
(long roleId)
-
Method Details
-
addRoleId
boolean addRoleId(long roleId) Adds the role ID to the collection.- Parameters:
roleId
- the ID of the role- Returns:
true
if the role ID was added to the collection
-
getCompanyId
long getCompanyId()Returns the primary key of the company whose permissions are being checked.- Returns:
- the primary key of the company whose permissions are being checked
-
getGroupId
long getGroupId()Returns the primary key of the group whose permissions are being checked.- Returns:
- the groupId of the Group currently being permission checked
-
getInitialRoleIds
long[] getInitialRoleIds()Returns the IDs of the initial set of roles calculated from persisted assignment and inheritance.- Returns:
- the IDs of the initial set of roles calculated from persisted assignment and inheritance
-
getUser
User getUser() -
getUserBag
UserBag getUserBag() -
hasRoleId
boolean hasRoleId(long roleId) Returnstrue
if the collection has the role ID.- Parameters:
roleId
- the ID of the role- Returns:
true
if the collection has the role ID;false
otherwise
-
isSignedIn
boolean isSignedIn()Returnstrue
if the user is signed in.- Returns:
true
if the user is signed in;false
otherwise
-
removeRoleId
boolean removeRoleId(long roleId)
-