public class RoleMapper extends Object implements Serializable, SecurityRoleMapper
Using this class the mapping information can be maintained and queried at a later time.
Constructor and Description |
---|
RoleMapper(RoleMapper r)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
assignRole(Principal p,
Role r,
RootDeploymentDescriptor rdd)
Assigns a Principal to the specified role.
|
Enumeration<Group> |
getGroupsAssignedTo(Role r)
Returns an enumeration of Groups assigned to the given role
|
String |
getName() |
Iterator<String> |
getRoles()
Returns an enumeration of roles for this rolemapper.
|
Map<String,Subject> |
getRoleToSubjectMapping()
Returns the RoleToSubjectMapping for the RoleMapping
|
Enumeration<Principal> |
getUsersAssignedTo(Role r)
Returns an enumeration of Principals assigned to the given role
|
void |
setName(String name)
Set the role mapper application name
|
String |
toString() |
void |
unassignPrincipalFromRole(Role role,
Principal principal)
Remove the given role-principal mapping
|
void |
unassignRole(Role r)
Remove all the role mapping information for this role
|
public RoleMapper(RoleMapper r)
public String getName()
getName
in interface SecurityRoleMapper
public void setName(String name)
SecurityRoleMapper
setName
in interface SecurityRoleMapper
name
- The application/module namepublic void unassignPrincipalFromRole(Role role, Principal principal)
unassignPrincipalFromRole
in interface SecurityRoleMapper
role,
- Role objectprincipal,
- the principalpublic Map<String,Subject> getRoleToSubjectMapping()
getRoleToSubjectMapping
in interface SecurityRoleMapper
public void assignRole(Principal p, Role r, RootDeploymentDescriptor rdd)
assignRole
in interface SecurityRoleMapper
p
- The principal that needs to be assigned to the role.r
- The Role the principal is being assigned to.rdd
- The descriptor of the module containing the role mappingpublic Iterator<String> getRoles()
getRoles
in interface SecurityRoleMapper
public Enumeration<Group> getGroupsAssignedTo(Role r)
getGroupsAssignedTo
in interface SecurityRoleMapper
The
- Role to which the groups are assigned to.public Enumeration<Principal> getUsersAssignedTo(Role r)
getUsersAssignedTo
in interface SecurityRoleMapper
The
- Role to which the principals are assigned to.public void unassignRole(Role r)
SecurityRoleMapper
unassignRole
in interface SecurityRoleMapper
Copyright © 2021. All rights reserved.