public interface RoleAssignmentService
AssignedRole
.Modifier and Type | Method and Description |
---|---|
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 |
hasPrivilegeAtContext(Privilege privilege,
RoleContext roleContext,
Principal member)
Check if the principal has the privilege at the given context.
|
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.
|
RoleAssignment getRoleAssignment(AssignedRole assignedRole) throws RoleAssignmentNotFoundException
assignedRole
- the assigned role's membership you wish to accessRoleAssignmentNotFoundException
- thrown when the specified role assignment was not found.RoleAssignment updateRoleAssignment(RoleAssignment roleAssignment) throws RoleAssignmentNotFoundException, RoleNotFoundException, InvalidRoleMemberException
roleAssignment
- the roleAssignment to updateRoleAssignmentNotFoundException
- thrown when the role assignment specified was not foundRoleNotFoundException
- thrown when the role specified on the role assignment does not existInvalidRoleMemberException
- thrown when a principal is assigned to the role and they are not eligible for
assignmentvoid removeFromRoleAssignmentsOfRoleContext(RoleContext roleContext, Principal member)
roleContext
- The context to search.member
- The principal to remove from all roleAssignments in the context.void removeMembersFromRoleAssignmentsOfRoleContext(RoleContext roleContext, Set<Principal> members)
roleContext
- The context to search.members
- The set of principals to remove from all roleAssignments in the specified context.Set<RoleAssignment> getRoleAssignments(RoleContext roleContext)
roleContext
- The context to search.Set<RoleAssignment> getRoleAssignmentsByRoleContextAndPrincipal(RoleContext roleContext, Principal member)
roleContext
- The context to search.member
- The principal to search for.Set<RoleAssignment> getRoleAssignmentsByRole(RoleDescriptor roleDescriptor)
roleDescriptor
- The role to search for.boolean isPrincipalInRole(AssignedRole assignedRole, Principal principal)
assignedRole
- The assignedRole to check.principal
- The principal to search for in the assignedRole.Set<AssignedRole> getAssignedRolesByPrincipal(RoleContext roleContext, Principal principal)
roleContext
- The context to search.principal
- The principal to search for within the context.boolean hasPrivilegeAtContext(Privilege privilege, RoleContext roleContext, Principal member) throws MemberNotFoundException, PrivilegeNotFoundException
privilege
- The specified privilege.roleContext
- The specified context.member
- The principal at the context.PrivilegeNotFoundException
- thrown if the privilege is not found at the given context or if the privilege is a global privilegeMemberNotFoundException
- thrown if the principal is not a member at the given contextCopyright (c) 2017, SAS Institute Inc., Cary, NC, USA