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 TypeMethodDescriptionbooleanaddRoleId(long roleId) Adds the role ID to the collection.longReturns the primary key of the company whose permissions are being checked.longReturns 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()booleanhasRoleId(long roleId) Returnstrueif the collection has the role ID.booleanReturnstrueif the user is signed in.booleanremoveRoleId(long roleId)
-
Method Details
-
addRoleId
boolean addRoleId(long roleId) Adds the role ID to the collection.- Parameters:
roleId- the ID of the role- Returns:
trueif 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) Returnstrueif the collection has the role ID.- Parameters:
roleId- the ID of the role- Returns:
trueif the collection has the role ID;falseotherwise
-
isSignedIn
boolean isSignedIn()Returnstrueif the user is signed in.- Returns:
trueif the user is signed in;falseotherwise
-
removeRoleId
boolean removeRoleId(long roleId)
-