org.rhq.enterprise.server.authz
Interface RoleManagerRemote

All Known Subinterfaces:
WebservicesRemote

public interface RoleManagerRemote

The remote interface to the role manager, providing a restricted set of Role Management services. that provides the API to manipulate the security rules within the JON Server.

Author:
Jay Shaughnessy

Method Summary
 void addResourceGroupsToRole(Subject subject, int roleId, int[] pendingGroupIds)
          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 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 subject, Role newRole)
          Persists the new role to the database.
 void deleteRoles(Subject subject, Integer[] roleIds)
          Removes a set of roles from the database.
 PageList<Role> findRolesByCriteria(Subject subject, RoleCriteria criteria)
           
 PageList<Role> findSubjectAssignedRoles(Subject subject, int subjectId, PageControl pc)
          Get all roles assigned for a certain subject
 PageList<Role> findSubjectUnassignedRoles(Subject subject, int subjectId, PageControl pc)
           
 Role getRole(Subject subject, int 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.
 Role updateRole(Subject subject, Role role)
          Updates the given role, excluding the subjects and groups.
 

Method Detail

getRole

Role getRole(Subject subject,
             int roleId)
Returns the role with the given ID

Parameters:
subject -
roleId -
Returns:
the role or null if it wasn't found

createRole

Role createRole(Subject subject,
                Role newRole)
Persists the new role to the database. The subjects assigned to the role are ignored - this only creates the role entity with 0 subjects initially assigned to it.

Parameters:
subject - The user attempting to create the role
newRole - The new role being created
Returns:
The persisted role with the primary key populated

deleteRoles

void deleteRoles(Subject subject,
                 Integer[] roleIds)
Removes a set of roles from the database. The subjects assigned to the roles are no longer authorized with the deleted roles. Groups attached to the deleted roles are left alone.

Parameters:
subject - The user attempting to delete the role
roleIds - The IDs of the roles to delete

updateRole

Role updateRole(Subject subject,
                Role role)
Updates the given role, excluding the subjects and groups. This updates permissions, name, description, etc.

Parameters:
subject - The user updating the role
role - The role being updated
Returns:
The updated role

findSubjectAssignedRoles

PageList<Role> findSubjectAssignedRoles(Subject subject,
                                        int subjectId,
                                        PageControl pc)
Get all roles assigned for a certain subject

Parameters:
subject - The logged in user's subject
subjectId - The subject ID to find the associated roles for
pc - PageControl
Returns:
A page list of assigned

findSubjectUnassignedRoles

PageList<Role> findSubjectUnassignedRoles(Subject subject,
                                          int subjectId,
                                          PageControl pc)

addRolesToSubject

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.

Parameters:
subject - The logged in user's subject.
subjectId - the subject who is to be authorized with the given roles
roleIds - the roles to assign

removeRolesFromSubject

void removeRolesFromSubject(Subject subject,
                            int subjectId,
                            int[] roleIds)
Disassociates particular roles from a subject. Once complete, the subject will no longer be authorized with the given roles.

Parameters:
subject - The logged in user's subject.
subjectId - the user that is to have the roles unassigned from it
roleIds - list of role IDs that are to be removed from user

addSubjectsToRole

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.

Parameters:
subject - the user attempting to assign the roles to the subject
roleId - the role who will authorized with the given subjects
subjectIds - the subjects to assign the role

removeSubjectsFromRole

void removeSubjectsFromRole(Subject subject,
                            int roleId,
                            int[] subjectIds)
Dissociate particular subjects from a role.

Parameters:
subject - The logged in user's subject.
roleId - The role ID to dissociate the roles from
subjectIds - The IDs of the subjects to remove from the specified Role

addResourceGroupsToRole

void addResourceGroupsToRole(Subject subject,
                             int roleId,
                             int[] pendingGroupIds)
Adds the given resource groups to the given role.

Parameters:
subject - The logged in user's subject.
roleId -
pendingGroupIds -

addRolesToResourceGroup

void addRolesToResourceGroup(Subject subject,
                             int groupId,
                             int[] roleIds)

removeResourceGroupsFromRole

void removeResourceGroupsFromRole(Subject subject,
                                  int roleId,
                                  int[] groupIds)
Removes the given resource groups from the given role.

Parameters:
subject - user attempting to remove the groups from the role
roleId -
groupIds -

removeRolesFromResourceGroup

void removeRolesFromResourceGroup(Subject subject,
                                  int groupId,
                                  int[] roleIds)

findRolesByCriteria

PageList<Role> findRolesByCriteria(Subject subject,
                                   RoleCriteria criteria)


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.