|
||||||||||
| 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(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. |
| 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 org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findRolesBySubject(int subjectId,
org.rhq.core.domain.util.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 org.rhq.core.domain.util.PageList<org.rhq.core.domain.authz.Role> findRoles(org.rhq.core.domain.util.PageControl pc)
RoleManagerLocal
findRoles 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)
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(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds,
boolean isLdap)
RoleManagerLocal.addRolesToSubject(Subject, int, int[])
public void addSubjectsToRole(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.Subject subject,
int subjectId,
int[] roleIds)
RoleManagerRemote
setAssignedSubjectRoles in interface RoleManagerLocalsetAssignedSubjectRoles in interface RoleManagerRemotepublic org.rhq.core.domain.authz.Role getRoleById(Integer roleId)
RoleManagerLocal
getRoleById 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)
RoleManagerLocal
getPermissions 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)
RoleManagerLocal
updateRole in interface RoleManagerLocalupdateRole in interface RoleManagerRemotewhoami - user asking to update the rolerole - The role being updated
RoleManagerLocal.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)
RoleManagerLocal.findSubjectsByRole(Integer roleId,PageControl pageControl)
public org.rhq.core.domain.util.PageList<org.rhq.core.domain.auth.Subject> findSubjectsByRole(Integer roleId,
org.rhq.core.domain.util.PageControl pc)
RoleManagerLocal
findSubjectsByRole 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)
RoleManagerLocal
findRolesByIds 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 subject
public 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 RoleManagerRemote
public void addResourceGroupsToRole(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] groupIds)
setAssignedResourceGroups in interface RoleManagerLocalsetAssignedResourceGroups in interface RoleManagerRemote
public 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)
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(org.rhq.core.domain.auth.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(org.rhq.core.domain.auth.Subject subject,
int roleId,
int[] subjectIds)
setAssignedSubjects in interface RoleManagerLocal
public void removeRolesFromResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds)
removeRolesFromResourceGroup in interface RoleManagerLocalremoveRolesFromResourceGroup in interface RoleManagerRemote
public org.rhq.core.domain.authz.Role getRole(org.rhq.core.domain.auth.Subject subject,
int roleId)
RoleManagerRemote
getRole in interface RoleManagerLocalgetRole in interface RoleManagerRemotenull if it wasn't found
public void addRolesToResourceGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] roleIds)
addRolesToResourceGroup in interface RoleManagerLocaladdRolesToResourceGroup in interface RoleManagerRemote
public 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 RoleManagerRemote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||