org.jcreme.permissioning
Class Role
java.lang.Object
org.jcreme.enumerations.Enumeration
org.jcreme.permissioning.Role
- All Implemented Interfaces:
- java.lang.Comparable, java.io.Serializable
- public class Role
- extends Enumeration
Role defines the business Roles available to Users. These Roles are
associated to business Tasks that can be legitimately carried out.
- Version:
- $Revision: 1.1 $
- Author:
- $Author: dbregeon $
- See Also:
- Serialized Form
| Fields inherited from class org.jcreme.enumerations.Enumeration |
|
|
Constructor Summary |
protected |
Role(java.lang.String name)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
fromName
protected static final java.util.Hashtable fromName
tasks
protected java.util.HashSet tasks
subRoles
protected java.util.HashSet subRoles
domain
protected Domain domain
Role
protected Role(java.lang.String name)
addSubRole
public void addSubRole(Role r)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
removeSubRole
public void removeSubRole(Role r)
isSubRole
protected boolean isSubRole(Role r)
addTask
public void addTask(Task t)
removeTask
public void removeTask(Task t)
getTasks
public Task[] getTasks()
hasTask
public boolean hasTask(Task t)
- Checks if the Role or one of its sub roles is authorized to perform that
Task. This applies to a business Task so the Task has to be directly
authorized for the Role.
- Parameters:
t - the Task to perform.
- Returns:
- true if the Role is authorized directly or indirectly to perform
the Task.
getPurpose
public Purpose getPurpose(Task t)
- This method provides the purpose that the role has to carry out the given
Task. There may be multiple purposes as Role may be authorized to carry
- Parameters:
t -
- Returns:
setDomain
public void setDomain(Domain d)
getDomain
public Domain getDomain()
get
public static Role get(java.lang.String name)
contains
public static boolean contains(java.lang.String name)
remove
public static void remove(java.lang.String name)
getFromName
protected java.util.Hashtable getFromName()
- Description copied from class:
Enumeration
- This method is for internal use only.
- Specified by:
getFromName in class Enumeration
- Returns:
- the Hashtable that links the enumerated values names with the
actual enumerated value.
- See Also:
Enumeration.getFromName()
getRoles
public static Role[] getRoles()
getValues
public static Enumeration[] getValues()
- Description copied from class:
Enumeration
- This method enables to retrieve all the possible values of an Enumeration
class. This method should be overriden in the subclasses to have the
desired result. The method in this class returns an empty array.
Copyright 2006 null. All Rights Reserved.