com.sas.hls.security.role
Interface RoleAssignmentService


public interface RoleAssignmentService

Service for defining and managing the membership of an AssignedRole.


Method Summary
 Set<AssignedRole> getAssignedRolesByPrincipal(RoleContext roleContext, Principal principal)
          Get all assignedRoles in a given context which have the specified principal as a member.
 RoleAssignment getRoleAssignment(AssignedRole assignedRole)
          Get the roleAssignment object for the specified assignedRole.
 Set<RoleAssignment> getRoleAssignments(RoleContext roleContext)
          Get all the roleAssignments for a specified context.
 Set<RoleAssignment> getRoleAssignmentsByRole(RoleDescriptor roleDescriptor)
          Get all roleAssignments across the system which involve the specified role.
 Set<RoleAssignment> getRoleAssignmentsByRoleContextAndPrincipal(RoleContext roleContext, Principal member)
          Get all the roleAssignments for a context which include the specified principal as a member.
 boolean isPrincipalInRole(AssignedRole assignedRole, Principal principal)
          Is the principal a member of the specified role?
 void removeFromRoleAssignmentsOfRoleContext(RoleContext roleContext, Principal member)
          Remove the specified principal from all roleAssignments in the specified context.
 void removeMembersFromRoleAssignmentsOfRoleContext(RoleContext roleContext, Set<Principal> members)
          Remove the specified principals from all roleAssignments in the specified context.
 RoleAssignment updateRoleAssignment(RoleAssignment roleAssignment)
          Update the specified roleAssignment.
 

Method Detail

getRoleAssignment

RoleAssignment getRoleAssignment(AssignedRole assignedRole)
                                 throws RoleAssignmentNotFoundException
Get the roleAssignment object for the specified assignedRole.

Parameters:
assignedRole - the assigned role's membership you wish to access
Returns:
the roleAssignment of that assignedRole
Throws:
RoleAssignmentNotFoundException - thrown when the specified role assignment was not found.

updateRoleAssignment

RoleAssignment updateRoleAssignment(RoleAssignment roleAssignment)
                                    throws RoleAssignmentNotFoundException,
                                           RoleNotFoundException,
                                           InvalidRoleMemberException
Update the specified roleAssignment.

Parameters:
roleAssignment - the roleAssignment to update
Returns:
the updated roleAssignment object.
Throws:
RoleAssignmentNotFoundException - thrown when the role assignment specified was not found
RoleNotFoundException - thrown when the role specified on the role assignment does not exist
InvalidRoleMemberException - thrown when a principal is assigned to the role and they are not eligible for assignment

removeFromRoleAssignmentsOfRoleContext

void removeFromRoleAssignmentsOfRoleContext(RoleContext roleContext,
                                            Principal member)
Remove the specified principal from all roleAssignments in the specified context.

Parameters:
roleContext - The context to search.
member - The principal to remove from all roleAssignments in the context.

removeMembersFromRoleAssignmentsOfRoleContext

void removeMembersFromRoleAssignmentsOfRoleContext(RoleContext roleContext,
                                                   Set<Principal> members)
Remove the specified principals from all roleAssignments in the specified context.

Parameters:
roleContext - The context to search.
members - The set of principals to remove from all roleAssignments in the specified context.

getRoleAssignments

Set<RoleAssignment> getRoleAssignments(RoleContext roleContext)
Get all the roleAssignments for a specified context.

Parameters:
roleContext - The context to search.
Returns:
The set of all roleAssignments defined in the specified context.

getRoleAssignmentsByRoleContextAndPrincipal

Set<RoleAssignment> getRoleAssignmentsByRoleContextAndPrincipal(RoleContext roleContext,
                                                                Principal member)
Get all the roleAssignments for a context which include the specified principal as a member.

Parameters:
roleContext - The context to search.
member - The principal to search for.
Returns:
The roleAssignments in that context which contain that member.

getRoleAssignmentsByRole

Set<RoleAssignment> getRoleAssignmentsByRole(RoleDescriptor roleDescriptor)
Get all roleAssignments across the system which involve the specified role.

Parameters:
roleDescriptor - The role to search for.
Returns:
The set of all roleAssignments for that role in the system.

isPrincipalInRole

boolean isPrincipalInRole(AssignedRole assignedRole,
                          Principal principal)
Is the principal a member of the specified role?

Parameters:
assignedRole - The assignedRole to check.
principal - The principal to search for in the assignedRole.
Returns:
boolean value indicating if the principal is in the role.

getAssignedRolesByPrincipal

Set<AssignedRole> getAssignedRolesByPrincipal(RoleContext roleContext,
                                              Principal principal)
Get all assignedRoles in a given context which have the specified principal as a member.

Parameters:
roleContext - The context to search.
principal - The principal to search for within the context.
Returns:
The set of all assignedRoles in that context which include the principal as a member.


Copyright (c) 2016, SAS Institute Inc., Cary, NC, USA