|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RoleManager
Describes the service interface for managing roles.
Method Summary | |
---|---|
Role |
addRole(java.lang.String roleName)
Add a new role |
Role |
addRole(java.lang.String roleName,
boolean mapped)
Add a new role and optionally map/replicate it to an external storage manager (if configured). |
void |
addRoleToGroup(java.lang.String roleName,
java.lang.String groupName)
Add a role to a group. |
void |
addRoleToRole(Role from,
Role to,
java.lang.String associationName)
Add a hierarchical association between two roles. |
void |
addRoleToUser(java.lang.String username,
java.lang.String roleName)
Add a role to a user. |
Role |
getRole(java.lang.String roleName)
Get a role Role for a given role name. |
java.util.List<java.lang.String> |
getRoleNames(java.lang.String nameFilter)
Retrieves a detached and modifiable List of role names, finding roles matching the corresponding role name filter. |
java.util.List<Role> |
getRoles(java.lang.String nameFilter)
Retrieves a detached and modifiable Role list matching the corresponding
role name filter. |
java.util.List<Role> |
getRolesAssociatedFrom(Role from,
java.lang.String associationName)
Retrieve all the roles which are associated from the provided role. |
java.util.List<Role> |
getRolesAssociatedTo(Role to,
java.lang.String associationName)
Retrieve all the roles which are associated to the provided role. |
java.util.List<Role> |
getRolesForUser(java.lang.String username)
Retrieves a detached and modifiable Role list of all the roles
associated to a specific user. |
java.util.List<Role> |
getRolesInGroup(java.lang.String groupName)
Retrieves a detached and modifiable Role list of all the roles
associated to a specific group. |
boolean |
isGroupInRole(java.lang.String groupName,
java.lang.String roleName)
Whether or not a role is in a group. |
boolean |
isUserInRole(java.lang.String username,
java.lang.String roleName)
Whether or not a user is in a role. |
Role |
newRole(java.lang.String name,
boolean mapped)
|
Role |
newTransientRole(java.lang.String name)
|
void |
removeRole(java.lang.String roleName)
Remove a given role |
void |
removeRoleFromGroup(java.lang.String roleName,
java.lang.String groupName)
Remove a role from a group. |
void |
removeRoleFromRole(Role from,
Role to,
java.lang.String associationName)
Remove a hierarchical association between two roles. |
void |
removeRoleFromUser(java.lang.String username,
java.lang.String roleName)
Remove a user from a role. |
boolean |
roleExists(java.lang.String roleName)
Whether or not a role exists. |
void |
updateRole(Role role)
Updates a role and all its attributes |
Methods inherited from interface org.apache.jetspeed.security.PrincipalTypeManager |
---|
getPrincipalManager, getPrincipalType |
Method Detail |
---|
Role newRole(java.lang.String name, boolean mapped)
Role newTransientRole(java.lang.String name)
Role addRole(java.lang.String roleName) throws SecurityException
Add a new role
If an external security storage manager is used, the role will be mapped/replicated to it as well.
roleName
- The role name
Role
Throws
- a security exception if the role already exists.
SecurityException
Role addRole(java.lang.String roleName, boolean mapped) throws SecurityException
Add a new role and optionally map/replicate it to an external storage manager (if configured).
roleName
- The role name.mapped
- if the new Role should be mapped/replicated to an external security storage manager (if used) or not.
Role
Throws
- a security exception if the role already exists.
SecurityException
void removeRole(java.lang.String roleName) throws SecurityException
Remove a given role
roleName
-
Throws
- a security exception.
SecurityException
boolean roleExists(java.lang.String roleName)
Whether or not a role exists.
roleName
-
Role getRole(java.lang.String roleName) throws SecurityException
Get a role Role
for a given role name.
roleName
- The role name
Role
.
Throws
- a security exception if the role does not exist.
SecurityException
java.util.List<Role> getRolesForUser(java.lang.String username) throws SecurityException
Retrieves a detached and modifiable Role
list of all the roles
associated to a specific user.
username
- The user name.
Role
.
Throws
- a security exception if the user does not exist.
SecurityException
java.util.List<Role> getRolesInGroup(java.lang.String groupName) throws SecurityException
Retrieves a detached and modifiable Role
list of all the roles
associated to a specific group.
groupName
- The group name
Role
.
Throws
- a security exception if the group does not exist.
SecurityException
void addRoleToUser(java.lang.String username, java.lang.String roleName) throws SecurityException
Add a role to a user.
username
- The user nameroleName
- The role name
Throws
- a security exception if the role or the user do not exist.
SecurityException
void removeRoleFromUser(java.lang.String username, java.lang.String roleName) throws SecurityException
Remove a user from a role.
username
- The user name.roleName
- The role name
Throws
- a security exception.
SecurityException
boolean isUserInRole(java.lang.String username, java.lang.String roleName) throws SecurityException
Whether or not a user is in a role.
username
- The user name.roleName
- The role name
Throws
- a security exception if the role or the user does not exist.
SecurityException
void addRoleToGroup(java.lang.String roleName, java.lang.String groupName) throws SecurityException
Add a role to a group.
roleName
- The role namegroupName
- The group name
Throws
- a security exception.
SecurityException
void removeRoleFromGroup(java.lang.String roleName, java.lang.String groupName) throws SecurityException
Remove a role from a group.
roleName
- The role namegroupName
- The group name
Throws
- a security exception.
SecurityException
boolean isGroupInRole(java.lang.String groupName, java.lang.String roleName) throws SecurityException
Whether or not a role is in a group.
groupName
- The group nameroleName
- The role name
Throws
- a security exception if the role or the group does not exist.
SecurityException
java.util.List<Role> getRoles(java.lang.String nameFilter) throws SecurityException
Role
list matching the corresponding
role name filter.
nameFilter
- The filter used to retrieve matching roles.
Role
SecurityException
java.util.List<java.lang.String> getRoleNames(java.lang.String nameFilter) throws SecurityException
Retrieves a detached and modifiable List of role names, finding roles matching the corresponding role name filter.
nameFilter
- The filter used to retrieve matching roles.
SecurityException
void updateRole(Role role) throws SecurityException
role
-
SecurityException
void addRoleToRole(Role from, Role to, java.lang.String associationName) throws SecurityException
Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A
and
JetspeedPrincipalAssociationType.IS_PART_OF
, but it will depend on the actual runtime configuration
if the required JetspeedPrincipalAssociationType
is available.
from
- The role for the from side of the associationto
- The role for the to side of the associationassociationName
- The name of the JetspeedAssociationType
to create
SecurityException
void removeRoleFromRole(Role from, Role to, java.lang.String associationName) throws SecurityException
Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A
and
JetspeedPrincipalAssociationType.IS_PART_OF
, but it will depend on the actual runtime configuration
if the required JetspeedPrincipalAssociationType
is available.
from
- The role for the from side of the associationto
- The role for the to side of the associationassociationName
- The name of the JetspeedAssociationType
to create
SecurityException
java.util.List<Role> getRolesAssociatedTo(Role to, java.lang.String associationName)
Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A
and
JetspeedPrincipalAssociationType.IS_PART_OF
, but it will depend on the actual runtime configuration
if the required JetspeedPrincipalAssociationType
is available.
If the corresponding JetspeedPrincipalAssociationType
is not available, this method will simply
return a empty list.
For a JetspeedPrincipalAssociationType.IS_PART_OF
association, this will return all
the nested roles which together represent the provided role.
For a JetspeedPrincipalAssociationType.IS_A
association, this will return all
the roles which extend the provided role.
Note: this method will only return the directly associated roles, not further derived associations.
to
- The role for the to side of the associationassociationName
- The name of the JetspeedAssociationType
to createjava.util.List<Role> getRolesAssociatedFrom(Role from, java.lang.String associationName)
Default supported hierarchical associations are JetspeedPrincipalAssociationType.IS_A
and
JetspeedPrincipalAssociationType.IS_PART_OF
, but it will depend on the actual runtime configuration
if the required JetspeedPrincipalAssociationType
is available.
If the corresponding JetspeedPrincipalAssociationType
is not available, this method will simply
return a empty list.
For a JetspeedPrincipalAssociationType.IS_PART_OF
association, this will return (at most)
the single role where the provided role is part of.
For a JetspeedPrincipalAssociationType.IS_A
association, this will return all
the roles which the provided role extends.
Note: this method will only return the directly associated role(s), not further derived associations.
from
- The role for the from side of the associationassociationName
- The name of the JetspeedAssociationType
to create
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |