|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.util.security.PermissionSet
This class represents a set of Permissions. It makes it easy to build a UI that would allow someone to add a group of Permissions to a Role. It wraps a TreeSet object to enforce that only Permission objects are allowed in the set and only relevant methods are available. TreeSet's contain only unique Objects (no duplicates).
Constructor Summary | |
PermissionSet()
Constructs an empty PermissionSet |
|
PermissionSet(java.util.Collection permissions)
Constructs a new PermissionSet with specifed contents. |
Method Summary | |
boolean |
add(java.util.Collection permissions)
Adds the Permissions in a Collection to this PermissionSet. |
boolean |
add(Permission permission)
Adds a Permission to this PermissionSet. |
boolean |
add(PermissionSet permissionSet)
Adds the Permissions in another PermissionSet to this PermissionSet. |
void |
clear()
Removes all Permissions from this PermissionSet. |
boolean |
contains(Permission permission)
Checks whether this PermissionSet contains a Permission. |
boolean |
contains(java.lang.String permissionName)
Compares by name a Permission with the Permissions contained in this PermissionSet. |
java.util.Iterator |
elements()
Returns an Iterator for Permissions in this PermissionSet. |
Permission |
getPermission(java.lang.String permissionName)
Returns a Permission with the given name, if it is contained in this PermissionSet. |
Permission[] |
getPermissionsArray()
Returns an Permissions[] of Permissions in this PermissionSet. |
boolean |
remove(Permission permission)
Removes a Permission from this PermissionSet. |
int |
size()
Returns size (cardinality) of this set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PermissionSet()
public PermissionSet(java.util.Collection permissions)
permissions
- A collection of permissions to be contained in the set.Method Detail |
public boolean add(Permission permission)
permission
- A Permission.public boolean add(java.util.Collection permissions)
permissions
- A Permission.public boolean add(PermissionSet permissionSet)
permissionSet
- A PermissionSet.public boolean remove(Permission permission)
permission
- A Permission.public void clear()
public boolean contains(Permission permission)
permission
- A Permission.public boolean contains(java.lang.String permissionName)
permissionName
- Name of Permission.public Permission getPermission(java.lang.String permissionName)
permissionName
- Name of Permission.public Permission[] getPermissionsArray()
public java.util.Iterator elements()
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |