Class RoleServiceImpl

java.lang.Object
org.kuali.rice.kim.impl.role.RoleServiceImpl
All Implemented Interfaces:
RoleService

public class RoleServiceImpl extends Object implements RoleService
  • Field Details

    • dataObjectService

      protected org.kuali.rice.krad.data.DataObjectService dataObjectService
    • identityService

      protected IdentityService identityService
    • namespaceService

      protected org.kuali.rice.coreservice.api.namespace.NamespaceService namespaceService
    • kimTypeInfoService

      protected KimTypeInfoService kimTypeInfoService
    • groupService

      protected GroupService groupService
    • responsibilityInternalService

      protected ResponsibilityInternalService responsibilityInternalService
    • roleDao

      protected RoleDao roleDao
    • dateTimeService

      protected org.kuali.rice.core.api.datetime.DateTimeService dateTimeService
  • Constructor Details

    • RoleServiceImpl

      public RoleServiceImpl()
  • Method Details

    • createRole

      public Role createRole(Role role) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      createRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • updateRole

      public Role updateRole(Role role) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      updateRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • checkForCircularRoleMembership

      protected boolean checkForCircularRoleMembership(String newMemberId, RoleBo roleBo)
      This method tests to see if assigning a roleBo to another roleBo will create a circular reference. The Role is checked to see if it is a member (direct or nested) of the roleBo to be assigned as a member.
      Returns:
      true - assignment is allowed, no circular reference will be created. false - illegal assignment, it will create a circular membership
    • findRoleMember

      protected RoleMember findRoleMember(String roleMemberId)
    • findRoleMembers

      public RoleMemberQueryResults findRoleMembers(QueryByCriteria queryByCriteria) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      findRoleMembers in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleTypeRoleMemberIds

      public Set<String> getRoleTypeRoleMemberIds(String roleId) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      Specified by:
      getRoleTypeRoleMemberIds in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
    • getMemberParentRoleIds

      public List<String> getMemberParentRoleIds(String memberType, String memberId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getMemberParentRoleIds in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleMemberResponsibilityActions

      public List<RoleResponsibilityAction> getRoleMemberResponsibilityActions(String roleMemberId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleMemberResponsibilityActions in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • findDelegateMembers

      public DelegateMemberQueryResults findDelegateMembers(QueryByCriteria queryByCriteria) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      findDelegateMembers in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRole

      public Role getRole(String roleId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • loadRole

      protected Role loadRole(String roleId)
      Loads the role with the given id, leveraging the cache where possible and querying the database if role not already in the cache. If the role is not in the cache, then it will be placed in the cache once it is loaded.
    • getRoleFromCache

      protected Role getRoleFromCache(String id)
    • getRoleFromCache

      protected Role getRoleFromCache(String namespaceCode, String name)
    • putRoleInCache

      protected void putRoleInCache(Role role)
    • getRoleBoLiteMap

      protected Map<String,RoleBoLite> getRoleBoLiteMap(Collection<String> roleIds)
    • getRoles

      public List<Role> getRoles(List<String> roleIds) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoles in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • loadRoles

      protected List<Role> loadRoles(List<String> roleIds)
      Loads the roles with the given ids, leveraging the cache where possible and querying the database for role ids not already in the cache. If the role is not in the cache, then it will be placed in the cache once it is loaded.
    • getRoleByNamespaceCodeAndName

      public Role getRoleByNamespaceCodeAndName(String namespaceCode, String roleName) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleByNamespaceCodeAndName in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • loadRoleByName

      protected Role loadRoleByName(String namespaceCode, String roleName)
      Loads the role with the given name, leveraging the cache where possible and querying the database if role not already in the cache. If the role is not in the cache, then it will be placed in the cache once it is loaded.
    • getRoleIdByNamespaceCodeAndName

      public String getRoleIdByNamespaceCodeAndName(String namespaceCode, String roleName) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleIdByNamespaceCodeAndName in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • isRoleActive

      public boolean isRoleActive(String roleId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      isRoleActive in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleQualifersForPrincipalByRoleIds

      public List<Map<String,String>> getRoleQualifersForPrincipalByRoleIds(String principalId, List<String> roleIds, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleQualifersForPrincipalByRoleIds in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleQualifersForPrincipalByNamespaceAndRolename

      public List<Map<String,String>> getRoleQualifersForPrincipalByNamespaceAndRolename(String principalId, String namespaceCode, String roleName, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleQualifersForPrincipalByNamespaceAndRolename in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getNestedRoleQualifersForPrincipalByNamespaceAndRolename

      public List<Map<String,String>> getNestedRoleQualifersForPrincipalByNamespaceAndRolename(String principalId, String namespaceCode, String roleName, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getNestedRoleQualifersForPrincipalByNamespaceAndRolename in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getNestedRoleQualifiersForPrincipalByRoleIds

      public List<Map<String,String>> getNestedRoleQualifiersForPrincipalByRoleIds(String principalId, List<String> roleIds, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getNestedRoleQualifiersForPrincipalByRoleIds in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleMembers

      public List<RoleMembership> getRoleMembers(List<String> roleIds, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleMembers in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleMemberPrincipalIds

      public Collection<String> getRoleMemberPrincipalIds(String namespaceCode, String roleName, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleMemberPrincipalIds in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • principalHasRole

      public boolean principalHasRole(String principalId, List<String> roleIds, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      principalHasRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getPrincipalIdSubListWithRole

      public List<String> getPrincipalIdSubListWithRole(List<String> principalIds, String roleNamespaceCode, String roleName, Map<String,String> qualification) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getPrincipalIdSubListWithRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • findRoles

      public RoleQueryResults findRoles(QueryByCriteria queryByCriteria) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      findRoles in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getFirstLevelRoleMembers

      public List<RoleMembership> getFirstLevelRoleMembers(List<String> roleIds) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getFirstLevelRoleMembers in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • findRoleMemberships

      public RoleMembershipQueryResults findRoleMemberships(QueryByCriteria queryByCriteria) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      findRoleMemberships in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getDelegationMembersByDelegationId

      public List<DelegateMember> getDelegationMembersByDelegationId(String delegationId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getDelegationMembersByDelegationId in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getDelegationMemberByDelegationAndMemberId

      public DelegateMember getDelegationMemberByDelegationAndMemberId(String delegationId, String memberId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getDelegationMemberByDelegationAndMemberId in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getDelegationMemberById

      public DelegateMember getDelegationMemberById(String delegationMemberId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getDelegationMemberById in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleResponsibilities

      public List<RoleResponsibility> getRoleResponsibilities(String roleId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getRoleResponsibilities in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getDelegateTypeByRoleIdAndDelegateTypeCode

      public DelegateType getDelegateTypeByRoleIdAndDelegateTypeCode(String roleId, org.kuali.rice.core.api.delegation.DelegationType delegationType) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getDelegateTypeByRoleIdAndDelegateTypeCode in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getDelegateTypeByDelegationId

      public DelegateType getDelegateTypeByDelegationId(String delegationId) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      getDelegateTypeByDelegationId in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • getRoleMembers

      protected List<RoleMembership> getRoleMembers(List<String> roleIds, Map<String,String> qualification, boolean followDelegations, Set<String> foundRoleTypeMembers)
    • applyDelegationsToRoleMembers

      protected List<RoleMembership.Builder> applyDelegationsToRoleMembers(List<RoleMembership> roleMemberships, Collection<DelegateTypeBo> delegations, Map<String,String> qualification)
      Checks each of the result records to determine if there are potentially applicable delegation members for that role membership. If there are, applicable delegations and members will be linked to the RoleMemberships in the given list. An updated list will be returned from this method which includes the appropriate linked delegations.
    • linkDelegateToRoleMembership

      protected void linkDelegateToRoleMembership(DelegateTypeBo delegation, DelegateMember.Builder delegateMemberBuilder, RoleMembership.Builder roleMembershipBuilder)
    • resolveDelegationMemberRoles

      protected void resolveDelegationMemberRoles(List<RoleMembership.Builder> membershipBuilders, Map<String,String> qualification, Set<String> foundRoleTypeMembers)
      Once the delegations for a RoleMembershipInfo object have been determined, any "role" member types need to be resolved into groups and principals so that further KIM requests are not needed.
    • principalHasRole

      public boolean principalHasRole(String principalId, List<String> roleIds, Map<String,String> qualification, boolean checkDelegations)
      Specified by:
      principalHasRole in interface RoleService
    • principalHasRole

      protected boolean principalHasRole(org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context, String principalId, List<String> roleIds, Map<String,String> qualification, boolean checkDelegations)
      Uses a multi-phase approach to determining if the given principal of any of the roles given based on the qualification map that is passed.
    • getPrincipalHasRoleFromCache

      protected Boolean getPrincipalHasRoleFromCache(String principalId, String roleId, Map<String,String> qualification, boolean checkDelegations)
    • putPrincipalHasRoleInCache

      protected boolean putPrincipalHasRoleInCache(boolean principalHasRole, String principalId, String roleId, Map<String,String> qualification, boolean checkDelegations)
    • principalHasDerivedRole

      protected boolean principalHasDerivedRole(org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context, String principalId, Role role, Map<String,String> qualification, RoleTypeService roleTypeService)
      Check for derived roles and extract principals and groups from that, then check them against the role type service passing in the qualification and principal.
    • checkForMatchOnQualifications

      protected boolean checkForMatchOnQualifications(org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context, String principalId, Role role, Map<String,String> qualification, RoleTypeService roleTypeService)
    • getQualifiersForExactMatch

      protected Map<String,String> getQualifiersForExactMatch(org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context, Role role, Map<String,String> qualification)
    • checkForMatchOnNestedRoles

      protected boolean checkForMatchOnNestedRoles(org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context, String principalId, Role role, Map<String,String> qualification, RoleTypeService roleTypeService)
    • getQualifiersForExactMatchFromRoleType

      protected List<String> getQualifiersForExactMatchFromRoleType(String kimTypeId, RoleTypeService roleTypeService)
    • isDerivedRoleType

      public boolean isDerivedRoleType(RoleTypeService service)
    • isDerivedRole

      public boolean isDerivedRole(String roleId)
      Specified by:
      isDerivedRole in interface RoleService
    • isDynamicRoleMembership

      public boolean isDynamicRoleMembership(String roleId)
      Specified by:
      isDynamicRoleMembership in interface RoleService
    • matchesOnDelegation

      protected boolean matchesOnDelegation(String roleId, String principalId, List<String> principalGroupIds, Map<String,String> qualification, org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context)
      Support method for principalHasRole. Checks delegations on the passed in roles for the given principal and groups. (It's assumed that the principal belongs to the given groups.)

      Delegation checks are mostly the same as role checks except that the delegateBo itself is qualified against the original role (like a RolePrincipal or RoleGroup.) And then, the members of that delegateBo may have additional qualifiers which are not part of the original role qualifiers.

      For example:

      A role could be qualified by organization. So, there is a person in the organization with primary authority for that org. But, then they delegate authority for that organization (not their authority - the delegateBo is attached to the org.) So, in this case the delegateBo has a qualifier of the organization when it is attached to the role.

      The principals then attached to that delegateBo (which is specific to the organization), may have additional qualifiers. For Example: dollar amount range, effective dates, document types. As a subsequent step, those qualifiers are checked against the qualification passed in from the client.

    • convertToRoleMemberships

      protected List<RoleMembership> convertToRoleMemberships(List<RoleMemberBo>... roleMemberLists)
    • getRoleIdToMembershipMap

      protected boolean getRoleIdToMembershipMap(Map<String,List<RoleMembership>> roleIdToMembershipMap, List<RoleMemberBo> roleMembers)
      Helper method used by principalHasRole to build the role ID -> list of members map.
      Returns:
      true if no further checks are needed because no role service is defined
    • getKimDelegationImpl

      protected DelegateTypeBo getKimDelegationImpl(String delegationId)
      Retrieves a KimDelegationImpl object by its ID. If the delegateBo already exists in the cache, this method will return the cached version; otherwise, it will retrieve the uncached version from the database and then cache it before returning it.
    • getDelegationTypeService

      protected DelegationTypeService getDelegationTypeService(String delegationId)
    • getNestedRoleMembers

      protected Collection<RoleMembership> getNestedRoleMembers(Map<String,String> qualification, RoleMembership rm, Set<String> foundRoleTypeMembers)
    • getKimDelegationMemberImplByDelegationAndId

      protected DelegateMemberBo getKimDelegationMemberImplByDelegationAndId(String delegationId, String delegationMemberId)
      Retrieves a KimDelegationMemberImpl object by its ID and the ID of the delegation it belongs to. If the delegation member exists in the cache, this method will return the cached one; otherwise, it will retrieve the uncached version from the database and then cache it before returning it.
    • assignPrincipalToRole

      public RoleMember assignPrincipalToRole(String principalId, String namespaceCode, String roleName, Map<String,String> qualifier) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      Specified by:
      assignPrincipalToRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
    • assignGroupToRole

      public RoleMember assignGroupToRole(String groupId, String namespaceCode, String roleName, Map<String,String> qualifier) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      assignGroupToRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • assignRoleToRole

      public RoleMember assignRoleToRole(String roleId, String namespaceCode, String roleName, Map<String,String> qualifier) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      assignRoleToRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • createRoleMember

      public RoleMember createRoleMember(RoleMember roleMember) throws org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      createRoleMember in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • updateRoleMember

      public RoleMember updateRoleMember(RoleMember roleMember) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      updateRoleMember in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • updateDelegateMember

      public DelegateMember updateDelegateMember(DelegateMember delegateMember) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      updateDelegateMember in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • createDelegateMember

      public DelegateMember createDelegateMember(DelegateMember delegateMember) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      createDelegateMember in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • removeDelegateMembers

      public void removeDelegateMembers(List<DelegateMember> delegateMembers) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      removeDelegateMembers in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • createRoleResponsibilityAction

      public RoleResponsibilityAction createRoleResponsibilityAction(RoleResponsibilityAction roleResponsibilityAction) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      createRoleResponsibilityAction in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • updateActionRequestsForRoleResponsibilityActionChange

      protected void updateActionRequestsForRoleResponsibilityActionChange(RoleResponsibilityActionBo bo)
      Queues ActionRequest refresh/regeneration for RoleResponsbilityAction change
      Parameters:
      bo - the changed or deleted RoleResponsibilityActionBo
    • updateRoleResponsibilityAction

      public RoleResponsibilityAction updateRoleResponsibilityAction(RoleResponsibilityAction roleResponsibilityAction) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      updateRoleResponsibilityAction in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • deleteRoleResponsibilityAction

      public void deleteRoleResponsibilityAction(String roleResponsibilityActionId) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      deleteRoleResponsibilityAction in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • createDelegateType

      public DelegateType createDelegateType(DelegateType delegateType) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      createDelegateType in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • updateDelegateType

      public DelegateType updateDelegateType(DelegateType delegateType) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException, org.kuali.rice.core.api.exception.RiceIllegalStateException
      Specified by:
      updateDelegateType in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      org.kuali.rice.core.api.exception.RiceIllegalStateException
    • removePrincipalFromRole

      public void removePrincipalFromRole(String principalId, String namespaceCode, String roleName, Map<String,String> qualifier) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      Specified by:
      removePrincipalFromRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
    • removeGroupFromRole

      public void removeGroupFromRole(String groupId, String namespaceCode, String roleName, Map<String,String> qualifier) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      Specified by:
      removeGroupFromRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
    • removeRoleFromRole

      public void removeRoleFromRole(String roleId, String namespaceCode, String roleName, Map<String,String> qualifier) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      Specified by:
      removeRoleFromRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
    • assignPermissionToRole

      public void assignPermissionToRole(String permissionId, String roleId) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      Specified by:
      assignPermissionToRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
    • revokePermissionFromRole

      public void revokePermissionFromRole(String permissionId, String roleId) throws org.kuali.rice.core.api.exception.RiceIllegalArgumentException
      Specified by:
      revokePermissionFromRole in interface RoleService
      Throws:
      org.kuali.rice.core.api.exception.RiceIllegalArgumentException
    • addMemberAttributeData

      protected void addMemberAttributeData(RoleMemberBo roleMember, Map<String,String> qualifier, String kimTypeId)
    • addDelegationMemberAttributeData

      protected void addDelegationMemberAttributeData(DelegateMemberBo delegationMember, Map<String,String> qualifier, String kimTypeId)
    • logPrincipalHasRoleCheck

      protected void logPrincipalHasRoleCheck(String principalId, List<String> roleIds, Map<String,String> roleQualifiers)
    • getProxiedRoleService

      protected RoleService getProxiedRoleService()
      This gets the proxied version of the role service which will go through Spring's caching mechanism for method calls rather than skipping it when methods are called directly.
      Returns:
      The proxied role service
    • setCacheManager

      public void setCacheManager(org.springframework.cache.CacheManager cacheManager)
      Sets the cache manager which this service implementation can for internal caching. Calling this setter is optional, though the value passed to it must not be null.
      Parameters:
      cacheManager - the cache manager to use for internal caching, must not be null
      Throws:
      IllegalArgumentException - if a null cache manager is passed
    • getDataSource

      protected DataSource getDataSource()
    • getVersionedRoleTypeService

      protected org.kuali.rice.kim.impl.role.RoleServiceImpl.VersionedService<RoleTypeService> getVersionedRoleTypeService(KimType typeInfo)
    • convertQualifierKeys

      protected Map<String,String> convertQualifierKeys(Map<String,String> qualification, Map<String,String> validAttributeIds)
      Converts the Qualifier Name/Value Role qualification set into Qualifier AttributeID/Value set
      Parameters:
      qualification - The original role qualification attribute set
      validAttributeIds - The mapping of attribute names to their matching attribute ids
      Returns:
      Converted Map<String, String> containing ID/value pairs
    • getNestedRoleTypeMemberIds

      protected void getNestedRoleTypeMemberIds(String roleId, Set<String> members)
    • getRoleMembersForPrincipalId

      protected List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds, String principalId)
    • getRoleMembersForPrincipalId

      protected List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds, String principalId, Map<String,String> qualification)
    • getRoleMembersForGroupIds

      protected List<RoleMemberBo> getRoleMembersForGroupIds(String roleId, List<String> groupIds)
    • getRoleMemberBoList

      protected List<RoleMemberBo> getRoleMemberBoList(org.kuali.rice.kim.impl.role.RoleServiceBase.RoleDaoAction daoActionToTake, Collection<String> roleIds, String principalId, Collection<String> groupIds, String memberTypeCode, Map<String,String> qualification)
      Retrieves a list of RoleMemberBo instances from the KimRoleDao.
      Parameters:
      daoActionToTake - An indicator for which KimRoleDao method should be used to get the results if the desired RoleMemberBos are not cached.
      roleIds - The role IDs to filter by; may get used as the IDs for members that are also roles, depending on the daoActionToTake value.
      principalId - The principal ID to filter by; may get ignored depending on the daoActionToTake value.
      groupIds - The group IDs to filter by; may get ignored depending on the daoActionToTake value.
      memberTypeCode - The member type code to filter by; may get overridden depending on the daoActionToTake value.
      qualification - The original role qualification attribute set
      Returns:
      A list of RoleMemberBo instances based on the provided parameters.
      Throws:
      IllegalArgumentException - if daoActionToTake refers to an enumeration constant that is not role-member-related.
    • getRoleGroupsForGroupIdsAndRoleIds

      public List<RoleMemberBo> getRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds, Collection<String> groupIds, Map<String,String> qualification)
    • getRoleMembershipsForRoleIdsAsMembers

      protected List<RoleMemberBo> getRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds, Map<String,String> qualification)
    • getRoleMembersForRoleIdsWithFilters

      protected List<RoleMemberBo> getRoleMembersForRoleIdsWithFilters(Collection<String> roleIds, String principalId, Collection<String> groupIds, Map<String,String> qualification)
    • getRoleMembershipsForPredicates

      protected List<RoleMemberBo> getRoleMembershipsForPredicates(Collection<Predicate> criteria)
    • getRoleQualificationPredicate

      protected Predicate getRoleQualificationPredicate(Map<String,String> qualification)
      Attempts to add predicates to the query to filter based on subqueries against the role member attribute data table. An "EXISTS" subquery will be created for each non-blank attribute value passed to this method and they will be anded together and returned to the calling code. The attribute value of the qualification will be compared using a "LIKE" operation. So, any non-escaped wildcard values (* or ?) will be respected.
      Parameters:
      qualification - An "and" predicate containing the exists predicates if at least one qualification has a non-blank value. null if all values are blank or the passed in qualification is null or empty.
    • getRoleMembershipsForMemberId

      protected List<RoleMemberBo> getRoleMembershipsForMemberId(String memberType, String memberId, Map<String,String> qualification)
    • getStoredRolePrincipalsForPrincipalIdAndRoleIds

      protected List<RoleMemberBo> getStoredRolePrincipalsForPrincipalIdAndRoleIds(Collection<String> roleIds, String principalId, Map<String,String> qualification)
      Calls the KimRoleDao's "getRolePrincipalsForPrincipalIdAndRoleIds" method and/or retrieves any corresponding members from the cache.
    • getStoredRoleGroupsForGroupIdsAndRoleIds

      protected List<RoleMemberBo> getStoredRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds, Collection<String> groupIds, Map<String,String> qualification)
      Calls the KimRoleDao's "getRoleGroupsForGroupIdsAndRoleIds" method and/or retrieves any corresponding members from the cache.
    • getStoredRoleMembersForRoleIds

      protected List<RoleMemberBo> getStoredRoleMembersForRoleIds(Collection<String> roleIds, String memberTypeCode, Map<String,String> qualification)
      Calls the KimRoleDao's "getRoleMembersForRoleIds" method and/or retrieves any corresponding members from the cache.
    • getStoredRoleMembershipsForRoleIdsAsMembers

      protected List<RoleMemberBo> getStoredRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds, Map<String,String> qualification)
      Calls the KimRoleDao's "getRoleMembershipsForRoleIdsAsMembers" method and/or retrieves any corresponding members from the cache.
    • getStoredRoleMembersForRoleIdsWithFilters

      protected List<RoleMemberBo> getStoredRoleMembersForRoleIdsWithFilters(Collection<String> roleIds, String principalId, List<String> groupIds, Map<String,String> qualification)
      Calls the KimRoleDao's "getRoleMembersForRoleIdsWithFilters" method and/or retrieves any corresponding members from the cache.
    • getRoleMemberBo

      protected RoleMemberBo getRoleMemberBo(String roleMemberId)
      Retrieves a RoleMemberBo object by its ID. If the role member already exists in the cache, this method will return the cached version; otherwise, it will retrieve the uncached version from the database and then cache it (if it belongs to a role that allows its members to be cached) before returning it.
    • getRoleResponsibilityActionBo

      protected RoleResponsibilityActionBo getRoleResponsibilityActionBo(String roleResponsibilityActionId)
      Retrieves a RoleResponsibilityActionBo object by its ID.
    • getStoredDelegationImplMapFromRoleIds

      protected Map<String,DelegateTypeBo> getStoredDelegationImplMapFromRoleIds(Collection<String> roleIds)
    • getStoredDelegationImplsForRoleIds

      protected List<DelegateTypeBo> getStoredDelegationImplsForRoleIds(Collection<String> roleIds)
    • getStoredDelegationPrincipalsForPrincipalIdAndDelegationIds

      protected List<DelegateMemberBo> getStoredDelegationPrincipalsForPrincipalIdAndDelegationIds(Collection<String> delegationIds, String principalId)
      Calls the KimRoleDao's "getDelegationPrincipalsForPrincipalIdAndDelegationIds" method and/or retrieves any corresponding members from the cache.
    • getDelegateMemberBo

      protected DelegateMemberBo getDelegateMemberBo(String delegationMemberId)
      Retrieves a DelegateMemberBo object by its ID. If the delegation member already exists in the cache, this method will return the cached version; otherwise, it will retrieve the uncached version from the database and then cache it before returning it.
    • getDelegationMemberBoListByMemberAndDelegationId

      protected List<DelegateMemberBo> getDelegationMemberBoListByMemberAndDelegationId(String memberId, String delegationId)
      Retrieves a DelegateMemberBo List by (principal/group/role) member ID and delegation ID. If the List already exists in the cache, this method will return the cached one; otherwise, it will retrieve the uncached version from the database and then cache it before returning it.
    • getMember

      protected Object getMember(String memberTypeCode, String memberId)
    • getMemberName

      protected String getMemberName(Object member)
    • getRoleBo

      protected RoleBo getRoleBo(String roleId)
    • getRoleBoLite

      protected RoleBoLite getRoleBoLite(String roleId)
    • getDelegationOfType

      protected DelegateTypeBo getDelegationOfType(String roleId, org.kuali.rice.core.api.delegation.DelegationType delegationType)
    • getPrimaryDelegation

      protected DelegateTypeBo getPrimaryDelegation(String roleId, List<DelegateTypeBo> roleDelegates)
    • matchingMemberRecord

      protected RoleMemberBo matchingMemberRecord(List<RoleMemberBo> roleMembers, String memberId, String memberTypeCode, Map<String,String> qualifier)
    • isDelegationPrimary

      protected boolean isDelegationPrimary(org.kuali.rice.core.api.delegation.DelegationType delegationType)
    • isDelegationSecondary

      protected boolean isDelegationSecondary(org.kuali.rice.core.api.delegation.DelegationType delegationType)
    • getRoleBoByName

      protected RoleBo getRoleBoByName(String namespaceCode, String roleName)
    • getRoleBoLiteByName

      protected RoleBoLite getRoleBoLiteByName(String namespaceCode, String roleName)
    • doAnyMemberRecordsMatchByExactQualifier

      protected List<RoleMember> doAnyMemberRecordsMatchByExactQualifier(RoleEbo role, String memberId, org.kuali.rice.kim.impl.role.RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
    • getRoleMembersByExactQualifierMatch

      protected List<RoleMemberBo> getRoleMembersByExactQualifierMatch(RoleEbo role, String memberId, org.kuali.rice.kim.impl.role.RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
    • doAnyMemberRecordsMatch

      protected RoleMember doAnyMemberRecordsMatch(List<RoleMemberBo> roleMembers, String memberId, String memberTypeCode, Map<String,String> qualifier)
    • doesMemberMatch

      protected boolean doesMemberMatch(RoleMemberBo roleMember, String memberId, String memberTypeCode, Map<String,String> qualifier)
    • getRoleTypeService

      protected RoleTypeService getRoleTypeService(String roleId)
      Retrieves the role type service associated with the given role ID
      Parameters:
      roleId - the role ID to get the role type service for
      Returns:
      the Role Type Service
    • getRoleTypeServiceByName

      protected RoleTypeService getRoleTypeServiceByName(String serviceName)
      Retrieves the role type service for the given service name.
      Parameters:
      serviceName - the name of the service to retrieve
      Returns:
      the Role Type Service
    • getRoleTypeService

      protected RoleTypeService getRoleTypeService(KimType typeInfo)
    • populateQualifiersForExactMatch

      protected Map<String,String> populateQualifiersForExactMatch(Map<String,String> defaultQualification, List<String> attributes)
    • getKimAttributeId

      protected String getKimAttributeId(String kimTypeId, String attributeName)
    • getAttributeByName

      protected Collection<KimAttributeBo> getAttributeByName(String attributeName)
    • getCorrectAttributeId

      protected String getCorrectAttributeId(String kimTypeId, String attributeName, Collection<KimAttributeBo> attributeData)
    • getAttributeFromKimType

      protected String getAttributeFromKimType(KimType kimType, String attributeName)
    • getAttributeFromNamespace

      protected String getAttributeFromNamespace(KimType kimType, String attributeName, Collection<KimAttributeBo> attributes)
    • getAppIdFromNamespace

      protected String getAppIdFromNamespace(String namespaceCode)
    • getAttributeFromAppId

      protected String getAttributeFromAppId(Collection<KimAttributeBo> attributes, String appId)
    • getKimTypeInfoService

      protected KimTypeInfoService getKimTypeInfoService()
    • getNamespaceService

      protected org.kuali.rice.coreservice.api.namespace.NamespaceService getNamespaceService()
    • getIdentityService

      protected IdentityService getIdentityService()
    • getGroupService

      protected GroupService getGroupService()
    • getResponsibilityInternalService

      protected ResponsibilityInternalService getResponsibilityInternalService()
    • getRoleDao

      protected RoleDao getRoleDao()
    • setRoleDao

      public void setRoleDao(RoleDao roleDao)
    • getDataObjectService

      public org.kuali.rice.krad.data.DataObjectService getDataObjectService()
    • setDataObjectService

      public void setDataObjectService(org.kuali.rice.krad.data.DataObjectService dataObjectService)
    • getDateTimeService

      public org.kuali.rice.core.api.datetime.DateTimeService getDateTimeService()
    • setDateTimeService

      public void setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
    • notifyOnMemberRemoval

      public final void notifyOnMemberRemoval(RoleMember member)