|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.authz.RoleManagerBean
public class RoleManagerBean
This bean provides functionality to manipulate the security roles. That is, adding/modifying/deleting
roles and their associated subjects and permissions is performed by this manager.
| Constructor Summary | |
|---|---|
RoleManagerBean()
|
|
| Method Summary | |
|---|---|
void |
addResourceGroupsToRole(Subject subject,
int roleId,
int[] groupIds)
Adds the given resource groups to the given role. |
void |
addRolesToResourceGroup(Subject subject,
int groupId,
int[] roleIds)
|
void |
addRolesToSubject(Subject subject,
int subjectId,
int[] roleIds)
Assigns a set of roles to a subject which authorizes the subject to do anything the roles permit. |
void |
addRolesToSubject(Subject subject,
int subjectId,
int[] roleIds,
boolean isLdap)
|
void |
addSubjectsToRole(Subject subject,
int roleId,
int[] subjectIds)
Assigns a set of subjects to a role which authorizes the subjects to do anything the role permits. |
Role |
createRole(Subject whoami,
Role newRole)
Persists the new role to the database. |
void |
deleteRoles(Subject subject,
int[] doomedRoleIds)
Removes a set of roles from the database. |
PageList<Role> |
findAvailableRolesForSubject(Subject subject,
Integer subjectId,
Integer[] pendingRoleIds,
PageControl pc)
This returns a list of roles that are available to be assigned to a given subject but not yet assigned to that subject. |
PageList<Role> |
findRoles(PageControl pc)
Returns a list of all roles in the system. |
PageList<Role> |
findRolesByCriteria(Subject subject,
RoleCriteria criteria)
|
PageList<Role> |
findRolesByIds(Integer[] roleIds,
PageControl pc)
Given a set of role Ids, this returns a list of all the roles. |
PageList<Role> |
findRolesBySubject(int subjectId,
PageControl pc)
This returns a page list of all the roles that a subject is authorized to access. |
PageList<Role> |
findSubjectAssignedRoles(Subject subject,
int subjectId,
PageControl pc)
Get all roles assigned for a certain subject |
PageList<Subject> |
findSubjectsByRole(Integer roleId,
PageControl pc)
Get all subjects that have been assigned the given role. |
PageList<Subject> |
findSubjectsByRole(Subject subject,
Integer roleId,
PageControl pc)
|
PageList<Role> |
findSubjectUnassignedRoles(Subject subject,
int subjectId,
PageControl pc)
|
Set<Permission> |
getPermissions(Integer roleId)
Given a role ID, this will return the complete set of authorized permissions for that role. |
Role |
getRole(Subject subject,
int roleId)
Returns the role with the given ID |
Role |
getRoleById(Integer roleId)
Returns the role with the given ID |
void |
removeResourceGroupsFromRole(Subject subject,
int roleId,
int[] groupIds)
Removes the given resource groups from the given role. |
void |
removeRolesFromResourceGroup(Subject subject,
int groupId,
int[] roleIds)
|
void |
removeRolesFromSubject(Subject subject,
int subjectId,
int[] roleIds)
Disassociates particular roles from a subject. |
void |
removeSubjectsFromRole(Subject subject,
int roleId,
int[] subjectIds)
Dissociate particular subjects from a role. |
void |
setAssignedResourceGroups(Subject subject,
int roleId,
int[] groupIds)
|
void |
setAssignedSubjectRoles(Subject subject,
int subjectId,
int[] roleIds)
Sets the set of roles assigned to a subject. |
void |
setAssignedSubjects(Subject subject,
int roleId,
int[] subjectIds)
|
void |
setPermissions(Subject subject,
Integer roleId,
Set<Permission> permissions)
Sets the permissions for the specified role. |
Role |
updateRole(Subject whoami,
Role role)
Updates the given role, excluding the subjects and groups. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoleManagerBean()
| Method Detail |
|---|
public PageList<Role> findRolesBySubject(int subjectId,
PageControl pc)
RoleManagerLocal
findRolesBySubject in interface RoleManagerLocalsubjectId - the id of the subject whose roles are to be returned
RoleManagerLocal.findRolesBySubject(int subjectId,PageControl pageControl)public PageList<Role> findRoles(PageControl pc)
RoleManagerLocal
findRoles in interface RoleManagerLocalRoleManagerLocal.findRoles(PageControl)
public Role createRole(Subject whoami,
Role newRole)
RoleManagerLocal
createRole in interface RoleManagerLocalcreateRole in interface RoleManagerRemotewhoami - the user attempting to create the rolenewRole - the new role to persist
RoleManagerLocal.createRole(Subject, Role)
public void deleteRoles(Subject subject,
int[] doomedRoleIds)
RoleManagerLocal
deleteRoles in interface RoleManagerLocaldeleteRoles in interface RoleManagerRemotesubject - the user attempting to delete the roledoomedRoleIds - the IDs of the roles to deleteRoleManagerLocal.deleteRoles(Subject, int[])
public void addRolesToSubject(Subject subject,
int subjectId,
int[] roleIds)
RoleManagerLocal
addRolesToSubject in interface RoleManagerLocaladdRolesToSubject in interface RoleManagerRemotesubject - the user attempting to assign the roles to the subjectsubjectId - the subject who is to be authorized with the given rolesroleIds - the roles to assignRoleManagerLocal.addRolesToSubject(Subject, int, int[])
public void addRolesToSubject(Subject subject,
int subjectId,
int[] roleIds,
boolean isLdap)
RoleManagerLocal.addRolesToSubject(Subject, int, int[])
public void addSubjectsToRole(Subject subject,
int roleId,
int[] subjectIds)
RoleManagerRemote
addSubjectsToRole in interface RoleManagerLocaladdSubjectsToRole in interface RoleManagerRemotesubject - the user attempting to assign the roles to the subjectroleId - the role who will authorized with the given subjectssubjectIds - the subjects to assign the roleRoleManagerLocal.addSubjectsToRole(Subject, int, int[])
public void removeRolesFromSubject(Subject subject,
int subjectId,
int[] roleIds)
RoleManagerLocal
removeRolesFromSubject in interface RoleManagerLocalremoveRolesFromSubject in interface RoleManagerRemotesubject - the user that is attempting to perform the removesubjectId - the user that is to have the roles unassigned from itroleIds - list of role IDs that are to be removed from userRoleManagerLocal.removeRolesFromSubject(Subject, int, int[])
public void setAssignedSubjectRoles(Subject subject,
int subjectId,
int[] roleIds)
RoleManagerRemote
setAssignedSubjectRoles in interface RoleManagerLocalsetAssignedSubjectRoles in interface RoleManagerRemotepublic Role getRoleById(Integer roleId)
RoleManagerLocal
getRoleById in interface RoleManagerLocalnull if it wasn't foundRoleManagerLocal.getRoleById(Integer)
public void setPermissions(Subject subject,
Integer roleId,
Set<Permission> permissions)
RoleManagerLocalpermissions will be the complete set of permissions the role will now be authorized with.
setPermissions in interface RoleManagerLocalsubject - the user attempting to peform the setroleId - the ID of the role to modifypermissions - a set of permissions to give to the roleRoleManagerLocal.setPermissions(Subject, Integer, Set)public Set<Permission> getPermissions(Integer roleId)
RoleManagerLocal
getPermissions in interface RoleManagerLocalRoleManagerLocal.getPermissions(Integer)
public Role updateRole(Subject whoami,
Role role)
RoleManagerLocal
updateRole in interface RoleManagerLocalupdateRole in interface RoleManagerRemotewhoami - user asking to update the rolerole - The role being updated
RoleManagerLocal.updateRole(Subject, Role)
public PageList<Subject> findSubjectsByRole(Subject subject,
Integer roleId,
PageControl pc)
RoleManagerLocal.findSubjectsByRole(Integer roleId,PageControl pageControl)
public PageList<Subject> findSubjectsByRole(Integer roleId,
PageControl pc)
RoleManagerLocal
findSubjectsByRole in interface RoleManagerLocalRoleManagerLocal.findSubjectsByRole(Integer,PageControl)
public PageList<Role> findRolesByIds(Integer[] roleIds,
PageControl pc)
RoleManagerLocal
findRolesByIds in interface RoleManagerLocalRoleManagerLocal.findRolesByIds(Integer[],PageControl)
public PageList<Role> findAvailableRolesForSubject(Subject subject,
Integer subjectId,
Integer[] pendingRoleIds,
PageControl pc)
RoleManagerLocalpendingRoleIds since it is assumed the pending roles will be assigned to the user.
findAvailableRolesForSubject in interface RoleManagerLocalsubject - user attempting to make this callsubjectId - the subject whose list of available roles are to be returnedpendingRoleIds - the list of roles that are planned to be given to the subject
public PageList<Role> findSubjectUnassignedRoles(Subject subject,
int subjectId,
PageControl pc)
findSubjectUnassignedRoles in interface RoleManagerLocalfindSubjectUnassignedRoles in interface RoleManagerRemote
public void addResourceGroupsToRole(Subject subject,
int roleId,
int[] groupIds)
RoleManagerLocal
addResourceGroupsToRole in interface RoleManagerLocaladdResourceGroupsToRole in interface RoleManagerRemotesubject - user attempting to add the groups to the roleRoleManagerLocal.addResourceGroupsToRole(Subject, int, int[])
public void removeResourceGroupsFromRole(Subject subject,
int roleId,
int[] groupIds)
RoleManagerLocal
removeResourceGroupsFromRole in interface RoleManagerLocalremoveResourceGroupsFromRole in interface RoleManagerRemotesubject - user attempting to remove the groups from the roleRoleManagerLocal.removeResourceGroupsFromRole(Subject, int, int[])
public void setAssignedResourceGroups(Subject subject,
int roleId,
int[] groupIds)
setAssignedResourceGroups in interface RoleManagerLocalsetAssignedResourceGroups in interface RoleManagerRemote
public PageList<Role> findSubjectAssignedRoles(Subject subject,
int subjectId,
PageControl pc)
RoleManagerRemote
findSubjectAssignedRoles in interface RoleManagerLocalfindSubjectAssignedRoles in interface RoleManagerRemotesubject - The logged in user's subjectsubjectId - The subject ID to find the associated roles forpc - PageControl
public void removeSubjectsFromRole(Subject subject,
int roleId,
int[] subjectIds)
RoleManagerRemote
removeSubjectsFromRole in interface RoleManagerLocalremoveSubjectsFromRole in interface RoleManagerRemotesubject - The logged in user's subject.roleId - The role ID to dissociate the roles fromsubjectIds - The IDs of the subjects to remove from the specified Role
public void setAssignedSubjects(Subject subject,
int roleId,
int[] subjectIds)
setAssignedSubjects in interface RoleManagerLocal
public void removeRolesFromResourceGroup(Subject subject,
int groupId,
int[] roleIds)
removeRolesFromResourceGroup in interface RoleManagerLocalremoveRolesFromResourceGroup in interface RoleManagerRemote
public Role getRole(Subject subject,
int roleId)
RoleManagerRemote
getRole in interface RoleManagerLocalgetRole in interface RoleManagerRemotenull if it wasn't found
public void addRolesToResourceGroup(Subject subject,
int groupId,
int[] roleIds)
addRolesToResourceGroup in interface RoleManagerLocaladdRolesToResourceGroup in interface RoleManagerRemote
public PageList<Role> findRolesByCriteria(Subject subject,
RoleCriteria criteria)
findRolesByCriteria in interface RoleManagerLocalfindRolesByCriteria in interface RoleManagerRemote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||