public class Role extends RoleDescriptor
RoleContext
. Examples of RoleContext are
Organization, Project and Analysis objects.
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.
OBJECT_TYPE
Constructor and Description |
---|
Role(Identifiable roleContext,
String name,
String identifier,
String description,
Set<Privilege> privileges)
Constructor
|
Role(ObjectIdentity roleContext,
String name,
String identifier,
String description,
Set<Privilege> privileges)
Constructor
|
Role(ObjectIdentity roleContext,
String name,
String identifier,
String description,
Set<Privilege> privileges,
long revision)
Constructor (internal version)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Indicate whether some other object is "equal to" this one.
|
Set<Privilege> |
getPrivileges()
Get the privileges associated with this role.
|
int |
hashCode()
Return a hash code value for the object.
|
void |
setPrivileges(Set<Privilege> privileges)
Set the privileges associated with this role.
|
RoleDescriptor |
toDescriptor()
Get a roleDescriptor for this role
|
static List<RoleDescriptor> |
toDescriptors(List<Role> roles)
Get roleDescriptors for these roles
|
String |
toString()
Return a string representation of the object.
|
getDescription, getIdentifier, getName, getObjectType, getRevision, getRoleContext, setDescription, setIdentifier, setName, setObjectType, setRevision, setRoleContext
public Role(ObjectIdentity roleContext, String name, String identifier, String description, Set<Privilege> privileges)
roleContext
- the context in which the role is being definedname
- the name of the roleidentifier
- the identifier of the roledescription
- the description of the roleprivileges
- the set of privileges of the rolepublic Role(ObjectIdentity roleContext, String name, String identifier, String description, Set<Privilege> privileges, long revision)
roleContext
- the context in which the role is being definedname
- the name of the roleidentifier
- the identifier of the roledescription
- the description of the roleprivileges
- the set of privileges of the rolerevision
- the internal revision number of this rolepublic Role(Identifiable roleContext, String name, String identifier, String description, Set<Privilege> privileges)
roleContext
- the context in which the role is being definedname
- the name of the roleidentifier
- the identifier of the roledescription
- the description of the roleprivileges
- the set of privileges of the rolepublic Set<Privilege> getPrivileges()
public void setPrivileges(Set<Privilege> privileges)
privileges
- the privileges to associate with this rolepublic int hashCode()
hashCode
in class RoleDescriptor
Object.hashCode()
public boolean equals(Object obj)
equals
in class RoleDescriptor
Object.equals(java.lang.Object)
public String toString()
toString
in class RoleDescriptor
Object.toString()
public RoleDescriptor toDescriptor()
public static List<RoleDescriptor> toDescriptors(List<Role> roles)
roles
- the list of roles for which to get roleDescriptorsCopyright (c) 2017, SAS Institute Inc., Cary, NC, USA