public class RoleManagerBean extends Object implements RoleManagerLocal, RoleManagerRemote
roles. That is, adding/modifying/deleting
roles and their associated subjects and permissions is performed by this manager.| Constructor and Description |
|---|
RoleManagerBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResourceGroupsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
Adds the given resource groups to the given role.
|
void |
addRolesToResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds) |
void |
addRolesToSubject(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds,
boolean isLdap) |
void |
addSubjectsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] subjectIds)
Assigns a set of subjects to a role which authorizes the subjects to do anything the role permits.
|
org.rhq.core.domain.authz.Role |
createRole(org.rhq.core.domain.auth.Subject whoami,
org.rhq.core.domain.authz.Role newRole)
Persists the new role to the database.
|
void |
deleteRoles(org.rhq.core.domain.auth.Subject subject,
int[] doomedRoleIds)
Removes a set of roles from the database.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> |
findAvailableRolesForSubject(org.rhq.core.domain.auth.Subject subject,
Integer subjectId,
Integer[] pendingRoleIds,
org.rhq.core.domain.util.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.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> |
findRoles(org.rhq.core.domain.util.PageControl pc)
Returns a list of all roles in the system.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> |
findRolesByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.RoleCriteria criteria) |
org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> |
findRolesByIds(Integer[] roleIds,
org.rhq.core.domain.util.PageControl pc)
Given a set of role Ids, this returns a list of all the roles.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> |
findRolesBySubject(int subjectId,
org.rhq.core.domain.util.PageControl pc)
This returns a page list of all the roles that a subject is authorized to access.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> |
findSubjectAssignedRoles(org.rhq.core.domain.auth.Subject subject,
int subjectId,
org.rhq.core.domain.util.PageControl pc)
Get all roles assigned for a certain subject
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.auth.Subject> |
findSubjectsByRole(Integer roleId,
org.rhq.core.domain.util.PageControl pc)
Get all subjects that have been assigned the given role.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.auth.Subject> |
findSubjectsByRole(org.rhq.core.domain.auth.Subject subject,
Integer roleId,
org.rhq.core.domain.util.PageControl pc) |
org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> |
findSubjectUnassignedRoles(org.rhq.core.domain.auth.Subject subject,
int subjectId,
org.rhq.core.domain.util.PageControl pc) |
Set<org.rhq.core.domain.authz.Permission> |
getPermissions(Integer roleId)
Given a role ID, this will return the complete set of authorized permissions for that role.
|
org.rhq.core.domain.authz.Role |
getRole(org.rhq.core.domain.auth.Subject subject,
int roleId)
Returns the role with the given ID
|
org.rhq.core.domain.authz.Role |
getRoleById(Integer roleId)
Returns the role with the given ID
|
void |
removeResourceGroupsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
Removes the given resource groups from the given role.
|
void |
removeRolesFromResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds) |
void |
removeRolesFromSubject(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
Disassociates particular roles from a subject.
|
void |
removeSubjectsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] subjectIds)
Dissociate particular subjects from a role.
|
void |
setAssignedResourceGroups(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds) |
void |
setAssignedSubjectRoles(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
Sets the set of roles assigned to a subject.
|
void |
setAssignedSubjects(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] subjectIds) |
void |
setPermissions(org.rhq.core.domain.auth.Subject subject,
Integer roleId,
Set<org.rhq.core.domain.authz.Permission> permissions)
Sets the permissions for the specified role.
|
org.rhq.core.domain.authz.Role |
updateRole(org.rhq.core.domain.auth.Subject whoami,
org.rhq.core.domain.authz.Role role)
Updates the given role, excluding the subjects and groups.
|
public org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findRolesBySubject(int subjectId,
org.rhq.core.domain.util.PageControl pc)
RoleManagerLocalfindRolesBySubject in interface RoleManagerLocalsubjectId - the id of the subject whose roles are to be returnedRoleManagerLocal.findRolesBySubject(int subjectId,PageControl pageControl)public org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findRoles(org.rhq.core.domain.util.PageControl pc)
RoleManagerLocalfindRoles in interface RoleManagerLocalRoleManagerLocal.findRoles(PageControl)public org.rhq.core.domain.authz.Role createRole(org.rhq.core.domain.auth.Subject whoami,
org.rhq.core.domain.authz.Role newRole)
RoleManagerLocalcreateRole in interface RoleManagerLocalcreateRole in interface RoleManagerRemotewhoami - the user attempting to create the rolenewRole - the new role to persistRoleManagerLocal.createRole(Subject, Role)public void deleteRoles(org.rhq.core.domain.auth.Subject subject,
int[] doomedRoleIds)
RoleManagerLocaldeleteRoles 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(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
RoleManagerLocaladdRolesToSubject 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(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds,
boolean isLdap)
public void addSubjectsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] subjectIds)
RoleManagerRemoteaddSubjectsToRole 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(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
RoleManagerLocalremoveRolesFromSubject 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(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
RoleManagerRemotesetAssignedSubjectRoles in interface RoleManagerLocalsetAssignedSubjectRoles in interface RoleManagerRemotepublic org.rhq.core.domain.authz.Role getRoleById(Integer roleId)
RoleManagerLocalgetRoleById in interface RoleManagerLocalnull if it wasn't foundRoleManagerLocal.getRoleById(Integer)public void setPermissions(org.rhq.core.domain.auth.Subject subject,
Integer roleId,
Set<org.rhq.core.domain.authz.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<org.rhq.core.domain.authz.Permission> getPermissions(Integer roleId)
RoleManagerLocalgetPermissions in interface RoleManagerLocalRoleManagerLocal.getPermissions(Integer)public org.rhq.core.domain.authz.Role updateRole(org.rhq.core.domain.auth.Subject whoami,
org.rhq.core.domain.authz.Role role)
RoleManagerLocalupdateRole in interface RoleManagerLocalupdateRole in interface RoleManagerRemotewhoami - user asking to update the rolerole - The role being updatedRoleManagerLocal.updateRole(Subject, Role)public org.rhq.core.domain.util.PageList<org.rhq.core.domain.auth.Subject> findSubjectsByRole(org.rhq.core.domain.auth.Subject subject,
Integer roleId,
org.rhq.core.domain.util.PageControl pc)
public org.rhq.core.domain.util.PageList<org.rhq.core.domain.auth.Subject> findSubjectsByRole(Integer roleId, org.rhq.core.domain.util.PageControl pc)
RoleManagerLocalfindSubjectsByRole in interface RoleManagerLocalRoleManagerLocal.findSubjectsByRole(Integer,PageControl)public org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findRolesByIds(Integer[] roleIds, org.rhq.core.domain.util.PageControl pc)
RoleManagerLocalfindRolesByIds in interface RoleManagerLocalRoleManagerLocal.findRolesByIds(Integer[],PageControl)public org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findAvailableRolesForSubject(org.rhq.core.domain.auth.Subject subject,
Integer subjectId,
Integer[] pendingRoleIds,
org.rhq.core.domain.util.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 subjectpublic org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findSubjectUnassignedRoles(org.rhq.core.domain.auth.Subject subject,
int subjectId,
org.rhq.core.domain.util.PageControl pc)
findSubjectUnassignedRoles in interface RoleManagerLocalfindSubjectUnassignedRoles in interface RoleManagerRemotepublic void addResourceGroupsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
RoleManagerLocaladdResourceGroupsToRole in interface RoleManagerLocaladdResourceGroupsToRole in interface RoleManagerRemotesubject - user attempting to add the groups to the roleRoleManagerLocal.addResourceGroupsToRole(Subject, int, int[])public void removeResourceGroupsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
RoleManagerLocalremoveResourceGroupsFromRole in interface RoleManagerLocalremoveResourceGroupsFromRole in interface RoleManagerRemotesubject - user attempting to remove the groups from the roleRoleManagerLocal.removeResourceGroupsFromRole(Subject, int, int[])public void setAssignedResourceGroups(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
setAssignedResourceGroups in interface RoleManagerLocalsetAssignedResourceGroups in interface RoleManagerRemotepublic org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findSubjectAssignedRoles(org.rhq.core.domain.auth.Subject subject,
int subjectId,
org.rhq.core.domain.util.PageControl pc)
RoleManagerRemotefindSubjectAssignedRoles in interface RoleManagerLocalfindSubjectAssignedRoles in interface RoleManagerRemotesubject - The logged in user's subjectsubjectId - The subject ID to find the associated roles forpc - PageControlpublic void removeSubjectsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] subjectIds)
RoleManagerRemoteremoveSubjectsFromRole 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 Rolepublic void setAssignedSubjects(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] subjectIds)
setAssignedSubjects in interface RoleManagerLocalpublic void removeRolesFromResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds)
removeRolesFromResourceGroup in interface RoleManagerLocalremoveRolesFromResourceGroup in interface RoleManagerRemotepublic org.rhq.core.domain.authz.Role getRole(org.rhq.core.domain.auth.Subject subject,
int roleId)
RoleManagerRemotegetRole in interface RoleManagerLocalgetRole in interface RoleManagerRemotenull if it wasn't foundpublic void addRolesToResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds)
addRolesToResourceGroup in interface RoleManagerLocaladdRolesToResourceGroup in interface RoleManagerRemotepublic org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findRolesByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.RoleCriteria criteria)
findRolesByCriteria in interface RoleManagerLocalfindRolesByCriteria in interface RoleManagerRemoteCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.