Class Role

  • All Implemented Interfaces:
    Identifiable, java.io.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:
    Serialized Form
    • Constructor Detail

      • Role

        public Role​(java.lang.String id,
                    ObjectIdentity definedContext,
                    ObjectIdentity assignedContext,
                    java.lang.String name,
                    java.lang.String description,
                    long revision,
                    java.util.Set<ScopedPrivilege> privileges,
                    java.util.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 Detail

      • getRevision

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

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

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class RoleDescriptor