|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.util.security.SecuritySet org.apache.turbine.util.security.RoleSet
This class represents a set of Roles. It makes it easy to build a UI that would allow someone to add a group of Roles to a User. It enforces that only Role 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 | |
RoleSet()
Constructs an empty RoleSet |
|
RoleSet(java.util.Collection roles)
Constructs a new RoleSet with specified contents. |
Method Summary | |
boolean |
add(java.util.Collection roles)
Adds the Roles in a Collection to this RoleSet. |
boolean |
add(Role role)
Adds a Role to this RoleSet. |
boolean |
add(RoleSet roleSet)
Adds the Roles in another RoleSet to this RoleSet. |
boolean |
contains(Role role)
Checks whether this RoleSet contains a Role. |
Role |
getRole(java.lang.String roleName)
Deprecated. Use getRoleByName instead. |
Role |
getRoleById(int roleId)
Returns a Role with the given id, if it is contained in this RoleSet. |
Role |
getRoleByName(java.lang.String roleName)
Returns a Role with the given name, if it is contained in this RoleSet. |
Role[] |
getRolesArray()
Returns an Array of Roles in this RoleSet. |
boolean |
remove(Role role)
Removes a Role from this RoleSet. |
java.lang.String |
toString()
Print out a RoleSet as a String |
Methods inherited from class org.apache.turbine.util.security.SecuritySet |
clear, contains, containsId, containsName, elements, 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 RoleSet()
public RoleSet(java.util.Collection roles)
roles
- A collection of roles to be contained in the set.Method Detail |
public boolean add(Role role)
role
- A Role.
public boolean add(java.util.Collection roles)
roles
- A Collection of Roles.
public boolean add(RoleSet roleSet)
roleSet
- A RoleSet.
public boolean remove(Role role)
role
- A Role.
public boolean contains(Role role)
role
- A Role.
public Role getRole(java.lang.String roleName)
roleName
- Name of Role.
public Role getRoleByName(java.lang.String roleName)
roleName
- Name of Role.
public Role getRoleById(int roleId)
roleId
- id of the Role.
public Role[] getRolesArray()
public java.lang.String toString()
toString
in class SecuritySet
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |