@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 Type
    Method
    Description
    boolean
    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.
     
     
    boolean
    hasRoleId(long roleId)
    Returns true if the collection has the role ID.
    boolean
    Returns true 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)
      Returns true 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()
      Returns true if the user is signed in.
      Returns:
      true if the user is signed in; false otherwise
    • removeRoleId

      boolean removeRoleId(long roleId)