|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jetspeed.security.impl.RoleManagerImpl
public class RoleManagerImpl
Implementation for managing roles.
Role hierarchy elements are being returned as a Rolecollection. The
backing implementation must appropriately map the role hierarchy to a
preferences sub-tree.
The convention {principal}.{subprincipal} has been chosen to name roles
hierachies in order to support declarative security. Implementation follow
the conventions enforced by the PreferencesAPI.
| Constructor Summary | |
|---|---|
RoleManagerImpl(SecurityProvider securityProvider)
|
|
| Method Summary | |
|---|---|
void |
addRole(java.lang.String roleFullPathName)
Add a new role. |
void |
addRoleToGroup(java.lang.String roleFullPathName,
java.lang.String groupFullPathName)
Add a role to a group. |
void |
addRoleToUser(java.lang.String username,
java.lang.String roleFullPathName)
Add a role to a user. |
Role |
getRole(java.lang.String roleFullPathName)
Get a role Role for a given role full path name. |
java.util.Iterator |
getRoles(java.lang.String filter)
Get all roles available from all role handlers |
java.util.Collection |
getRolesForUser(java.lang.String username)
A collection of Role for all the roles
associated to a specific user. |
java.util.Collection |
getRolesInGroup(java.lang.String groupFullPathName)
A collection of Role for all the roles
associated to a specific group. |
boolean |
isGroupInRole(java.lang.String groupFullPathName,
java.lang.String roleFullPathName)
Whether or not a role is in a group. |
boolean |
isUserInRole(java.lang.String username,
java.lang.String roleFullPathName)
Whether or not a user is in a role. |
void |
removeRole(java.lang.String roleFullPathName)
Remove a given role and all the children of that role. |
void |
removeRoleFromGroup(java.lang.String roleFullPathName,
java.lang.String groupFullPathName)
Remove a role from a group. |
void |
removeRoleFromUser(java.lang.String username,
java.lang.String roleFullPathName)
Remove a user from a role. |
boolean |
roleExists(java.lang.String roleFullPathName)
Whether or not a role exists. |
void |
setRoleEnabled(java.lang.String roleFullPathName,
boolean enabled)
Enable or disable a role. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoleManagerImpl(SecurityProvider securityProvider)
securityProvider - The security provider.| Method Detail |
|---|
public void addRole(java.lang.String roleFullPathName)
throws SecurityException
RoleManagerAdd a new role.
Role principal names are expressed as {principal}.{subprincipal} where "." is the separator expressing the hierarchical nature of a role.
Role principal path names are stored leveraging the Preferences
api. Roles will be stored under /role/theGroupName/theGroupNameChild
when given the full path name theRoleName.theRoleNameChild.
addRole in interface RoleManagerroleFullPathName - The role name full path
(e.g. theRoleName.theRoleNameChild).
SecurityExceptionRoleManager.addRole(java.lang.String)
public void removeRole(java.lang.String roleFullPathName)
throws SecurityException
RoleManagerRemove a given role and all the children of that role.
Role principal names are expressed as {principal}.{subprincipal} where "." is the separator expressing the hierarchical nature of a role.
Role principal path names are stored leveraging the Preferences
api. Roles will be stored under /role/theGroupName/theGroupNameChild
when given the full path name theRoleName.theRoleNameChild.
removeRole in interface RoleManagerroleFullPathName - The role name full path
(e.g. theRoleName.theRoleNameChild).
SecurityExceptionRoleManager.removeRole(java.lang.String)public boolean roleExists(java.lang.String roleFullPathName)
RoleManagerWhether or not a role exists.
roleExists in interface RoleManagerroleFullPathName - The role name full path
(e.g. theRoleName.theRoleNameChild).
RoleManager.roleExists(java.lang.String)
public Role getRole(java.lang.String roleFullPathName)
throws SecurityException
RoleManagerGet a role Role for a given role full path name.
getRole in interface RoleManagerroleFullPathName - The role name full path
(e.g. theRoleName.theRoleNameChild).
Preferences node.
SecurityExceptionRoleManager.getRole(java.lang.String)
public java.util.Collection getRolesForUser(java.lang.String username)
throws SecurityException
RoleManagerA collection of Role for all the roles
associated to a specific user.
getRolesForUser in interface RoleManagerusername - The user name.
Role.
SecurityExceptionRoleManager.getRolesForUser(java.lang.String)
public java.util.Collection getRolesInGroup(java.lang.String groupFullPathName)
throws SecurityException
RoleManagerA collection of Role for all the roles
associated to a specific group.
getRolesInGroup in interface RoleManagergroupFullPathName - The group full path
(e.g. theGroupName.theGroupChildName).
Role.
SecurityExceptionRoleManager.getRolesInGroup(java.lang.String)
public void addRoleToUser(java.lang.String username,
java.lang.String roleFullPathName)
throws SecurityException
RoleManagerAdd a role to a user.
addRoleToUser in interface RoleManagerusername - The user name.roleFullPathName - The role name full path
(e.g. theRoleName.theRoleChildName).
SecurityExceptionRoleManager.addRoleToUser(java.lang.String,
java.lang.String)
public void removeRoleFromUser(java.lang.String username,
java.lang.String roleFullPathName)
throws SecurityException
RoleManagerRemove a user from a role.
removeRoleFromUser in interface RoleManagerusername - The user name.roleFullPathName - The role name full path relative to the
/role node (e.g. /theRoleName/theRoleChildName).
SecurityExceptionRoleManager.removeRoleFromUser(java.lang.String,
java.lang.String)
public boolean isUserInRole(java.lang.String username,
java.lang.String roleFullPathName)
throws SecurityException
RoleManagerWhether or not a user is in a role.
isUserInRole in interface RoleManagerusername - The user name.roleFullPathName - The role name full path
(e.g. theRoleName.theRoleChildName).
SecurityExceptionRoleManager.isUserInRole(java.lang.String,
java.lang.String)
public void addRoleToGroup(java.lang.String roleFullPathName,
java.lang.String groupFullPathName)
throws SecurityException
RoleManagerAdd a role to a group.
addRoleToGroup in interface RoleManagerroleFullPathName - The role name full path
(e.g. theRoleName.theRoleChildName).groupFullPathName - The group name full path
(e.g. theGroupName.theGroupChildName).
SecurityExceptionRoleManager.addRoleToGroup(java.lang.String,
java.lang.String)
public void removeRoleFromGroup(java.lang.String roleFullPathName,
java.lang.String groupFullPathName)
throws SecurityException
RoleManagerRemove a role from a group.
removeRoleFromGroup in interface RoleManagerroleFullPathName - The role name full path
(e.g. theRoleName.theRoleChildName).groupFullPathName - The group name full path
(e.g. theGroupName.theGroupChildName).
SecurityExceptionRoleManager.removeRoleFromGroup(java.lang.String,
java.lang.String)
public boolean isGroupInRole(java.lang.String groupFullPathName,
java.lang.String roleFullPathName)
throws SecurityException
RoleManagerWhether or not a role is in a group.
isGroupInRole in interface RoleManagergroupFullPathName - The group name full path
(e.g. theGroupName.theGroupChildName).roleFullPathName - The role name full path
(e.g. theRoleName.theRoleChildName).
SecurityExceptionRoleManager.isGroupInRole(java.lang.String,
java.lang.String)
public java.util.Iterator getRoles(java.lang.String filter)
throws SecurityException
RoleManager
getRoles in interface RoleManagerfilter - The filter used to retrieve matching roles.
Principal
SecurityExceptionRoleManager.getRoles(java.lang.String)
public void setRoleEnabled(java.lang.String roleFullPathName,
boolean enabled)
throws SecurityException
RoleManager
setRoleEnabled in interface RoleManagerroleFullPathName - The role name full path
(e.g. theRoleName.theRoleChildName).enabled - enabled flag for the role
SecurityExceptionRoleManager.setRoleEnabled(java.lang.String, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||