Class Role

All Implemented Interfaces:
Identifiable, Serializable

public class Role extends RoleDescriptor
A role is a logical grouping of privileges. A role can be defined with a set of privileges that are required to perform actions by a user assigned to that role. A role is associated with and scoped to a context where it is defined. A role context is a repository context that is configured with the membership capability.

Members (users and groups) of that context may be assigned to the roles associated with a given role context. This will grant them all the privileges of the role.

Since:
1.2
See Also:
  • Constructor Details

    • Role

      public Role(String id, ObjectIdentity definedContext, ObjectIdentity assignedContext, String name, String description, long revision, Set<ScopedPrivilege> privileges, Set<Principal> members)
      It is not intended or recommended that the consumer of this API construct these objects. They should only deal with the roles returned by the API.
      Parameters:
      id - the unique identifier of this role.
      definedContext - the context where this role was defined.
      assignedContext - the context where this role is being assigned.
      name - the name of this role.
      description - the description of this role.
      revision - the internal revision number of this role.
      privileges - the privileges associated with this role.
      members - the members associated with this role.
  • Method Details

    • getRevision

      public long getRevision()
      Gets the internal revision number of this object.
      Returns:
      The internal revision number of this object.
    • getMembers

      public Set<Principal> getMembers()
      Gets the members assigned to this role.
      Returns:
      The members assigned to this role.
    • setMembers

      public void setMembers(Set<Principal> members)
      Sets the members assigned to this role.
      Parameters:
      members - the members assigned to this role.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class RoleDescriptor
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class RoleDescriptor
    • toString

      public String toString()
      Overrides:
      toString in class RoleDescriptor