|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.turbine.util.security.SecuritySet<Permission>
org.apache.turbine.util.security.PermissionSet
public class 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 enforces that only Permission objects are allowed in the set and only relevant methods are available.
| Field Summary |
|---|
| Fields inherited from class org.apache.turbine.util.security.SecuritySet |
|---|
idMap, nameMap |
| Constructor Summary | |
|---|---|
PermissionSet()
Constructs an empty PermissionSet |
|
PermissionSet(Collection<Permission> permissions)
Constructs a new PermissionSet with specified contents. |
|
| Method Summary | |
|---|---|
boolean |
add(Collection<Permission> 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. |
boolean |
contains(Permission permission)
Checks whether this PermissionSet contains a Permission. |
Permission |
getPermissionById(int permissionId)
Returns a Permission with the given id, if it is contained in this PermissionSet. |
Permission |
getPermissionByName(String permissionName)
Returns a Permission with the given name, if it is contained in this PermissionSet. |
Permission[] |
getPermissionsArray()
Returns an Array of Permissions in this PermissionSet. |
boolean |
remove(Permission permission)
Removes a Permission from this PermissionSet. |
String |
toString()
Print out a PermissionSet as a String |
| Methods inherited from class org.apache.turbine.util.security.SecuritySet |
|---|
clear, containsId, containsName, getIds, getNames, getSet, iterator, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PermissionSet()
public PermissionSet(Collection<Permission> 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(Collection<Permission> permissions)
permissions - A Collection of Permissions.
public boolean add(PermissionSet permissionSet)
permissionSet - A PermissionSet.
public boolean remove(Permission permission)
permission - A Permission.
public boolean contains(Permission permission)
permission - A Permission.
public Permission getPermissionByName(String permissionName)
permissionName - Name of Permission.
public Permission getPermissionById(int permissionId)
permissionId - Id of the Permission.
public Permission[] getPermissionsArray()
public String toString()
toString in class SecuritySet<Permission>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||