Package com.sas.lsaf.security.role
Class RoleDescriptor
- java.lang.Object
-
- com.sas.lsaf.core.AbstractIdentifiable
-
- com.sas.lsaf.security.role.RoleDescriptor
-
- All Implemented Interfaces:
Identifiable
,java.io.Serializable
- Direct Known Subclasses:
Role
public class RoleDescriptor extends AbstractIdentifiable
A lightweight representation of a role.- Since:
- 1.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RoleDescriptor(java.lang.String id, ObjectIdentity definedContext, ObjectIdentity assignedContext, java.lang.String name, java.lang.String description, java.util.Set<ScopedPrivilege> privileges)
It is not intended or recommended that the consumer of this API construct these objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
ObjectIdentity
getAssignedContext()
Gets the context where a role was assigned.ObjectIdentity
getDefinedContext()
Gets the context where a role is defined.java.lang.String
getDescription()
Gets the description of a role.java.lang.String
getName()
Gets the name of a role.java.util.Set<ScopedPrivilege>
getPrivileges()
Gets the privileges assigned to a role.int
hashCode()
boolean
isInherited()
Checks if this role is a defined role or an inherited role.void
setDescription(java.lang.String description)
Sets the description of a role.void
setName(java.lang.String name)
Sets the name of a role.void
setPrivileges(java.util.Set<ScopedPrivilege> privileges)
Sets the privileges assigned to a role.java.lang.String
toString()
-
Methods inherited from class com.sas.lsaf.core.AbstractIdentifiable
getId, getTypeId
-
-
-
-
Constructor Detail
-
RoleDescriptor
public RoleDescriptor(java.lang.String id, ObjectIdentity definedContext, ObjectIdentity assignedContext, java.lang.String name, java.lang.String description, java.util.Set<ScopedPrivilege> privileges)
It is not intended or recommended that the consumer of this API construct these objects. They should only deal with the role descriptors 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.privileges
- the privileges associated with this role.
-
-
Method Detail
-
getDefinedContext
public ObjectIdentity getDefinedContext()
Gets the context where a role is defined.- Returns:
- The context where a role is defined.
-
getAssignedContext
public ObjectIdentity getAssignedContext()
Gets the context where a role was assigned. If a role is a defined role a context value will always match thegetDefinedContext()
value. If a role is inherited then this value will be a descendant context where the role was inherited.- Returns:
- The context where this role has been applied.
-
isInherited
public boolean isInherited()
Checks if this role is a defined role or an inherited role.- Returns:
true
if this role is an inherited role,false
if this a defined role.
-
getName
public java.lang.String getName()
Gets the name of a role.- Returns:
- The name of this role.
-
setName
public void setName(java.lang.String name)
Sets the name of a role.- Parameters:
name
- the name of this role.
-
getDescription
public java.lang.String getDescription()
Gets the description of a role.- Returns:
- The description of this role.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of a role.- Parameters:
description
- the description of this role.
-
getPrivileges
public java.util.Set<ScopedPrivilege> getPrivileges()
Gets the privileges assigned to a role.- Returns:
- The privileges assigned to this role.
-
setPrivileges
public void setPrivileges(java.util.Set<ScopedPrivilege> privileges)
Sets the privileges assigned to a role.- Parameters:
privileges
- the privileges to assign to this role.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractIdentifiable
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classAbstractIdentifiable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractIdentifiable
-
-