Class RoleDescriptor

java.lang.Object
net.bluemind.role.api.RoleDescriptor

public class RoleDescriptor extends Object
Declaration of a role.
  • Field Details

    • id

      public String id
      Unique identifier.
    • parentRoleId

      public String parentRoleId
      Parent role, this role inherits all permissions of the parent role.
    • categoryId

      public String categoryId
      Associated
      invalid reference
      RoleCategory
      .
    • label

      public String label
      Label.
    • description

      public String description
      Role description.
    • selfPromote

      public boolean selfPromote
      Role applies to own roles only.
    • dirEntryPromote

      public boolean dirEntryPromote
      Role applies to associated directory entry.
    • dirEntryKind

      public BaseDirEntry.Kind dirEntryKind
      Role applies to specific directory entry kind.
    • siblingRole

      public String siblingRole
      Sibling role //FIXME explain
    • childsRole

      public Set<String> childsRole
      Child roles.
    • visible

      public boolean visible
      Visible in administration.
    • delegable

      public boolean delegable
      Role can be delegated.
    • containerRoles

      public Set<String> containerRoles
      Role applies to containers.
    • priority

      public int priority
      Role priority //FIXME unused
  • Constructor Details

    • RoleDescriptor

      public RoleDescriptor()
  • Method Details

    • create

      public static RoleDescriptor create(String id, String categoryId, String label, String description)
    • giveRoles

      public RoleDescriptor giveRoles(String... roles)
      Assign child roles.
      Parameters:
      roles - Array of roles.
      Returns:
      A reference to the current instance (this).
    • withParent

      public RoleDescriptor withParent(String parentRoleId)
      Assign a parent role.
      Parameters:
      parentRoleId - Parent role id.
      Returns:
      A reference to the current instance (this).
    • withSelfPromote

      public RoleDescriptor withSelfPromote(String parentRoleId)
      Assign permission to own a role in the context of the specific owner of this role. A user owning this role will hava permission "parentRoleId" on the entities he owns.
      Parameters:
      parentRoleId - Role identifier.
      Returns:
      A reference to the current instance (this).
    • withContainerRoles

      public RoleDescriptor withContainerRoles(String... roles)
      Assign container roles.
      Parameters:
      roles - Array of roles.
      Returns:
      A reference to the current instance (this).
    • notVisible

      public RoleDescriptor notVisible()
      Hide this role.
      Returns:
      A reference to the current instance (this).
    • delegable

      public RoleDescriptor delegable()
      Make this role delegable.
      Returns:
      A reference to the current instance (this).
    • priotity

      public RoleDescriptor priotity(int priority)
      Assign a priority.
      Parameters:
      priority -
      Returns:
      A reference to the current instance (this).
    • forDirEntry

      public RoleDescriptor forDirEntry(BaseDirEntry.Kind kind, String siblingRole, String parentId)
    • forDirEntry

      public RoleDescriptor forDirEntry(BaseDirEntry.Kind kind)