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 |
addBundleGroupsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] bundleGroupIds)
Adds the given bundle groups to the given role.
|
void |
addResourceGroupsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
Adds the given resource groups to the given role.
|
void |
addRolesToBundleGroup(org.rhq.core.domain.auth.Subject subject,
int bundleGroupId,
int[] roleIds) |
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)
Get all roles eligible to be assigned to the user.
|
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 |
removeBundleGroupsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] bundleGroupIds)
Removes the given bundle groups from the given role.
|
void |
removeResourceGroupsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
Removes the given resource groups from the given role.
|
void |
removeRolesFromBundleGroup(org.rhq.core.domain.auth.Subject subject,
int bundleGroupId,
int[] roleIds)
Remove the bundle group from the specified roles.
|
void |
removeRolesFromResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds)
Remove the resource group from the specified roles.
|
void |
removeRolesFromSubject(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
Remove 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 |
setAssignedBundleGroups(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] bundleGroupIds)
Set the specified bundle groups on the role, replacing the previous set of bundle groups.
|
void |
setAssignedResourceGroups(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
Set the specified resource groups on the role, replacing the previous set of resource groups.
|
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 including permissions.
|
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)
RoleManagerRemotecreateRole in interface RoleManagerRemotewhoami - The user attempting to create the rolenewRole - The new role being createdRoleManagerRemote.createRole(Subject, Role)public void deleteRoles(org.rhq.core.domain.auth.Subject subject,
int[] doomedRoleIds)
RoleManagerRemotedeleteRoles in interface RoleManagerRemotesubject - The user attempting to delete the roledoomedRoleIds - The IDs of the roles to deleteRoleManagerRemote.deleteRoles(Subject, int[])public void addRolesToSubject(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
RoleManagerRemoteaddRolesToSubject in interface RoleManagerRemotesubject - The logged in user's subject.subjectId - the subject who is to be authorized with the given rolesroleIds - the roles to assignRoleManagerRemote.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 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 roleRoleManagerRemote.addSubjectsToRole(Subject, int, int[])public void removeRolesFromSubject(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
RoleManagerRemoteremoveRolesFromSubject in interface RoleManagerRemotesubject - The logged in user's subject.subjectId - the user that is to have the roles unassigned from itroleIds - list of role IDs that are to be removed from userRoleManagerRemote.removeRolesFromSubject(Subject, int, int[])public void setAssignedSubjectRoles(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
RoleManagerRemotesetAssignedSubjectRoles 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)
RoleManagerRemoteupdateRole in interface RoleManagerRemotewhoami - The user updating the rolerole - The role being updatedRoleManagerRemote.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)
RoleManagerRemotefindSubjectUnassignedRoles in interface RoleManagerRemotepublic void addBundleGroupsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] bundleGroupIds)
RoleManagerRemoteaddBundleGroupsToRole in interface RoleManagerRemotesubject - The logged in user's subject.public void addResourceGroupsToRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
RoleManagerRemoteaddResourceGroupsToRole in interface RoleManagerRemotesubject - The logged in user's subject.RoleManagerRemote.addResourceGroupsToRole(Subject, int, int[])public void removeBundleGroupsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] bundleGroupIds)
RoleManagerRemoteremoveBundleGroupsFromRole in interface RoleManagerRemotesubject - user attempting to remove the groups from the rolepublic void removeResourceGroupsFromRole(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
RoleManagerRemoteremoveResourceGroupsFromRole in interface RoleManagerRemotesubject - user attempting to remove the groups from the roleRoleManagerRemote.removeResourceGroupsFromRole(Subject, int, int[])public void setAssignedBundleGroups(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] bundleGroupIds)
RoleManagerRemotesetAssignedBundleGroups in interface RoleManagerRemotepublic void setAssignedResourceGroups(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
RoleManagerRemotesetAssignedResourceGroups 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 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 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 removeRolesFromBundleGroup(org.rhq.core.domain.auth.Subject subject,
int bundleGroupId,
int[] roleIds)
RoleManagerRemoteremoveRolesFromBundleGroup in interface RoleManagerRemotepublic void removeRolesFromResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds)
RoleManagerRemoteremoveRolesFromResourceGroup in interface RoleManagerRemotepublic org.rhq.core.domain.authz.Role getRole(org.rhq.core.domain.auth.Subject subject,
int roleId)
RoleManagerRemotegetRole in interface RoleManagerRemotenull if it wasn't foundpublic void addRolesToBundleGroup(org.rhq.core.domain.auth.Subject subject,
int bundleGroupId,
int[] roleIds)
addRolesToBundleGroup in interface RoleManagerRemotepublic void addRolesToResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds)
addRolesToResourceGroup 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 RoleManagerRemoteCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.