public class RoleServiceImpl extends Object implements RoleService
Modifier and Type | Class and Description |
---|---|
protected static class |
RoleServiceBase.RoleDaoAction
A helper enumeration for indicating which KimRoleDao method to use when attempting to get role/delegation-related lists that are not in the cache.
|
Modifier and Type | Field and Description |
---|---|
protected DataObjectService |
dataObjectService |
protected DateTimeService |
dateTimeService |
protected GroupService |
groupService |
protected IdentityService |
identityService |
protected KimTypeInfoService |
kimTypeInfoService |
protected NamespaceService |
namespaceService |
protected ResponsibilityInternalService |
responsibilityInternalService |
protected RoleDao |
roleDao |
Constructor and Description |
---|
RoleServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDelegationMemberAttributeData(DelegateMemberBo delegationMember,
Map<String,String> qualifier,
String kimTypeId) |
protected void |
addMemberAttributeData(RoleMemberBo roleMember,
Map<String,String> qualifier,
String kimTypeId) |
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.
|
RoleMember |
assignGroupToRole(String groupId,
String namespaceCode,
String roleName,
Map<String,String> qualifier)
Assigns the group with the given id to the role with the specified
namespace code and name with the supplied set of qualifications.
|
void |
assignPermissionToRole(String permissionId,
String roleId)
Assigns the given permission to the given role
|
RoleMember |
assignPrincipalToRole(String principalId,
String namespaceCode,
String roleName,
Map<String,String> qualifier)
Assigns the principal with the given id to the role with the specified
namespace code and name with the supplied set of qualifications.
|
RoleMember |
assignRoleToRole(String roleId,
String namespaceCode,
String roleName,
Map<String,String> qualifier)
Assigns the role with the given id to the role with the specified
namespace code and name with the supplied set of qualifications.
|
protected boolean |
checkForCircularRoleMembership(String newMemberId,
RoleBo roleBo)
This method tests to see if assigning a roleBo to another roleBo will create a circular reference.
|
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
|
protected List<RoleMembership> |
convertToRoleMemberships(List<RoleMemberBo>... roleMemberLists) |
DelegateMember |
createDelegateMember(DelegateMember delegateMember)
Creates a new DelegateMember.
|
DelegateType |
createDelegateType(DelegateType delegateType)
Creates a new DelegateType.
|
Role |
createRole(Role role)
This will create a
Role exactly like the role passed in. |
RoleMember |
createRoleMember(RoleMember roleMember)
Creates a new RoleMember.
|
RoleResponsibilityAction |
createRoleResponsibilityAction(RoleResponsibilityAction roleResponsibilityAction)
Creates a new RoleResponsibilityAction.
|
void |
deleteRoleResponsibilityAction(String roleResponsibilityActionId)
Deletes the given RoleResponsibilityAction
|
protected RoleMember |
doAnyMemberRecordsMatch(List<RoleMemberBo> roleMembers,
String memberId,
String memberTypeCode,
Map<String,String> qualifier) |
protected List<RoleMember> |
doAnyMemberRecordsMatchByExactQualifier(RoleEbo role,
String memberId,
RoleServiceBase.RoleDaoAction daoActionToTake,
Map<String,String> qualifier) |
protected boolean |
doesMemberMatch(RoleMemberBo roleMember,
String memberId,
String memberTypeCode,
Map<String,String> qualifier) |
DelegateMemberQueryResults |
findDelegateMembers(QueryByCriteria queryByCriteria)
Gets role members based on the given search criteria.
|
protected RoleMember |
findRoleMember(String roleMemberId) |
RoleMemberQueryResults |
findRoleMembers(QueryByCriteria queryByCriteria)
Gets role members based on the given search criteria.
|
RoleMembershipQueryResults |
findRoleMemberships(QueryByCriteria queryByCriteria)
Gets role member information based on the given search criteria.
|
RoleQueryResults |
findRoles(QueryByCriteria queryByCriteria)
This method gets search results for role lookup
|
protected String |
getAppIdFromNamespace(String namespaceCode) |
protected Collection<KimAttributeBo> |
getAttributeByName(String attributeName) |
protected String |
getAttributeFromAppId(Collection<KimAttributeBo> attributes,
String appId) |
protected String |
getAttributeFromKimType(KimType kimType,
String attributeName) |
protected String |
getAttributeFromNamespace(KimType kimType,
String attributeName,
Collection<KimAttributeBo> attributes) |
protected String |
getCorrectAttributeId(String kimTypeId,
String attributeName,
Collection<KimAttributeBo> attributeData) |
DataObjectService |
getDataObjectService() |
protected DataSource |
getDataSource() |
DateTimeService |
getDateTimeService() |
protected DelegateMemberBo |
getDelegateMemberBo(String delegationMemberId)
Retrieves a DelegateMemberBo object by its ID.
|
DelegateType |
getDelegateTypeByDelegationId(String delegationId)
Gets a DelegateType for the given delegation id.
|
DelegateType |
getDelegateTypeByRoleIdAndDelegateTypeCode(String roleId,
DelegationType delegationType)
Gets a DelegateType for the given role id and delegation type.
|
protected List<DelegateMemberBo> |
getDelegationMemberBoListByMemberAndDelegationId(String memberId,
String delegationId)
Retrieves a DelegateMemberBo List by (principal/group/role) member ID and delegation ID.
|
DelegateMember |
getDelegationMemberByDelegationAndMemberId(String delegationId,
String memberId)
Gets the delegate member for the given delegationId and memberId.
|
DelegateMember |
getDelegationMemberById(String delegationMemberId)
Gets the delegate member with the given delegation member id.
|
List<DelegateMember> |
getDelegationMembersByDelegationId(String delegationId)
Gets the delegate members for the given delegation.
|
protected DelegateTypeBo |
getDelegationOfType(String roleId,
DelegationType delegationType) |
protected DelegationTypeService |
getDelegationTypeService(String delegationId) |
List<RoleMembership> |
getFirstLevelRoleMembers(List<String> roleIds)
Gets all direct members of the roles that have ids within the given list
of role ids.
|
protected GroupService |
getGroupService() |
protected IdentityService |
getIdentityService() |
protected String |
getKimAttributeId(String kimTypeId,
String attributeName) |
protected DelegateTypeBo |
getKimDelegationImpl(String delegationId)
Retrieves a KimDelegationImpl object by its ID.
|
protected DelegateMemberBo |
getKimDelegationMemberImplByDelegationAndId(String delegationId,
String delegationMemberId)
Retrieves a KimDelegationMemberImpl object by its ID and the ID of the delegation it belongs to.
|
protected KimTypeInfoService |
getKimTypeInfoService() |
protected Object |
getMember(String memberTypeCode,
String memberId) |
protected String |
getMemberName(Object member) |
List<String> |
getMemberParentRoleIds(String memberType,
String memberId)
Gets a list of Roles that the given member belongs to.
|
protected NamespaceService |
getNamespaceService() |
protected Collection<RoleMembership> |
getNestedRoleMembers(Map<String,String> qualification,
RoleMembership rm,
Set<String> foundRoleTypeMembers) |
List<Map<String,String>> |
getNestedRoleQualifersForPrincipalByNamespaceAndRolename(String principalId,
String namespaceCode,
String roleName,
Map<String,String> qualification)
Returns a list of role qualifiers that the given principal.
|
List<Map<String,String>> |
getNestedRoleQualifiersForPrincipalByRoleIds(String principalId,
List<String> roleIds,
Map<String,String> qualification)
Returns a list of role qualifiers that the given principal.
|
protected void |
getNestedRoleTypeMemberIds(String roleId,
Set<String> members) |
protected DelegateTypeBo |
getPrimaryDelegation(String roleId,
List<DelegateTypeBo> roleDelegates) |
protected Boolean |
getPrincipalHasRoleFromCache(String principalId,
String roleId,
Map<String,String> qualification,
boolean checkDelegations) |
List<String> |
getPrincipalIdSubListWithRole(List<String> principalIds,
String roleNamespaceCode,
String roleName,
Map<String,String> qualification)
Returns the subset of the given principal ID list which has the given role and qualification.
|
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.
|
protected List<String> |
getQualifiersForExactMatch(String kimTypeId,
RoleTypeService roleTypeService) |
protected ResponsibilityInternalService |
getResponsibilityInternalService() |
Role |
getRole(String roleId)
Get the KIM Role object with the given ID.
|
protected RoleBo |
getRoleBo(String roleId) |
protected RoleBo |
getRoleBoByName(String namespaceCode,
String roleName) |
protected RoleBoLite |
getRoleBoLite(String roleId) |
protected RoleBoLite |
getRoleBoLiteByName(String namespaceCode,
String roleName) |
protected Map<String,RoleBoLite> |
getRoleBoLiteMap(Collection<String> roleIds) |
Role |
getRoleByNamespaceCodeAndName(String namespaceCode,
String roleName)
Get the KIM Role object with the unique combination of namespace, component,
and role name.
|
protected RoleDao |
getRoleDao() |
protected Role |
getRoleFromCache(String id) |
protected Role |
getRoleFromCache(String namespaceCode,
String name) |
List<RoleMemberBo> |
getRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds,
Collection<String> groupIds,
Map<String,String> qualification) |
String |
getRoleIdByNamespaceCodeAndName(String namespaceCode,
String roleName)
Return the Role ID for the given unique combination of namespace,
component and role name.
|
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.
|
protected RoleMemberBo |
getRoleMemberBo(String roleMemberId)
Retrieves a RoleMemberBo object by its ID.
|
protected List<RoleMemberBo> |
getRoleMemberBoList(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.
|
Collection<String> |
getRoleMemberPrincipalIds(String namespaceCode,
String roleName,
Map<String,String> qualification)
This method gets all the members, then traverses down into members of type role and group to obtain the nested principal ids
|
List<RoleResponsibilityAction> |
getRoleMemberResponsibilityActions(String roleMemberId)
Gets a list of RoleResponsibilityActions for the given role member id.
|
List<RoleMembership> |
getRoleMembers(List<String> roleIds,
Map<String,String> qualification)
Get all the role members (groups and principals) associated with the given list of roles
where their role membership/assignment matches the given qualification.
|
protected List<RoleMembership> |
getRoleMembers(List<String> roleIds,
Map<String,String> qualification,
boolean followDelegations,
Set<String> foundRoleTypeMembers) |
protected List<RoleMemberBo> |
getRoleMembersByExactQualifierMatch(RoleEbo role,
String memberId,
RoleServiceBase.RoleDaoAction daoActionToTake,
Map<String,String> qualifier) |
protected List<RoleMemberBo> |
getRoleMembersForGroupIds(String roleId,
List<String> groupIds) |
protected List<RoleMemberBo> |
getRoleMembersForPrincipalId(Collection<String> roleIds,
String principalId) |
protected List<RoleMemberBo> |
getRoleMembersForPrincipalId(Collection<String> roleIds,
String principalId,
Map<String,String> qualification) |
protected List<RoleMemberBo> |
getRoleMembersForRoleIdsWithFilters(Collection<String> roleIds,
String principalId,
Collection<String> groupIds,
Map<String,String> qualification) |
protected List<RoleMemberBo> |
getRoleMembershipsForMemberId(String memberType,
String memberId,
Map<String,String> qualification) |
protected List<RoleMemberBo> |
getRoleMembershipsForPredicates(Collection<Predicate> criteria) |
protected List<RoleMemberBo> |
getRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds,
Map<String,String> qualification) |
List<Map<String,String>> |
getRoleQualifersForPrincipalByNamespaceAndRolename(String principalId,
String namespaceCode,
String roleName,
Map<String,String> qualification)
Returns a list of role qualifiers that the given principal has without taking into consideration
that the principal may be a member via an assigned group or role.
|
List<Map<String,String>> |
getRoleQualifersForPrincipalByRoleIds(String principalId,
List<String> roleIds,
Map<String,String> qualification)
Returns a list of role qualifiers that the given principal has without taking into consideration
that the principal may be a member via an assigned group or role.
|
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.
|
List<RoleResponsibility> |
getRoleResponsibilities(String roleId)
Gets a list of role reponsibilities for the given role id.
|
protected RoleResponsibilityActionBo |
getRoleResponsibilityActionBo(String roleResponsibilityActionId)
Retrieves a RoleResponsibilityActionBo object by its ID.
|
List<Role> |
getRoles(List<String> roleIds)
Get the KIM Role objects for the role IDs in the given List.
|
Set<String> |
getRoleTypeRoleMemberIds(String roleId)
Gets a list of Roles Ids that are a member of the given roleId, including nested membership.
|
protected RoleTypeService |
getRoleTypeService(KimType typeInfo) |
protected RoleTypeService |
getRoleTypeService(String roleId)
Retrieves the role type service associated with the given role ID
|
protected RoleTypeService |
getRoleTypeServiceByName(String serviceName)
Retrieves the role type service for the given service name.
|
protected Map<String,DelegateTypeBo> |
getStoredDelegationImplMapFromRoleIds(Collection<String> roleIds) |
protected List<DelegateTypeBo> |
getStoredDelegationImplsForRoleIds(Collection<String> roleIds) |
protected List<DelegateMemberBo> |
getStoredDelegationPrincipalsForPrincipalIdAndDelegationIds(Collection<String> delegationIds,
String principalId)
Calls the KimRoleDao's "getDelegationPrincipalsForPrincipalIdAndDelegationIds" method and/or retrieves any corresponding members from the cache.
|
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.
|
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.
|
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.
|
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.
|
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.
|
protected org.kuali.rice.kim.impl.role.RoleServiceImpl.VersionedService<RoleTypeService> |
getVersionedRoleTypeService(KimType typeInfo) |
protected boolean |
isDelegationPrimary(DelegationType delegationType) |
protected boolean |
isDelegationSecondary(DelegationType delegationType) |
boolean |
isDerivedRole(String roleId)
Determines if a role with a provided id is a derived role
|
boolean |
isDerivedRoleType(RoleTypeService service) |
boolean |
isDynamicRoleMembership(String roleId)
Determines if a role with a provided id is a uses dynamic role memberships
|
boolean |
isRoleActive(String roleId)
Checks whether the role with the given role ID is active.
|
protected void |
linkDelegateToRoleMembership(DelegateTypeBo delegation,
DelegateMember.Builder delegateMemberBuilder,
RoleMembership.Builder roleMembershipBuilder) |
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.
|
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.
|
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.
|
protected void |
logPrincipalHasRoleCheck(String principalId,
List<String> roleIds,
Map<String,String> roleQualifiers) |
protected boolean |
matchesOnDelegation(Set<String> allRoleIds,
String principalId,
List<String> principalGroupIds,
Map<String,String> qualification,
org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context)
Support method for principalHasRole.
|
protected RoleMemberBo |
matchingMemberRecord(List<RoleMemberBo> roleMembers,
String memberId,
String memberTypeCode,
Map<String,String> qualifier) |
void |
notifyOnMemberRemoval(RoleMember member) |
protected Map<String,String> |
populateQualifiersForExactMatch(Map<String,String> defaultQualification,
List<String> attributes) |
protected boolean |
principalHasRole(org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context,
String principalId,
List<String> roleIds,
Map<String,String> qualification,
boolean checkDelegations) |
boolean |
principalHasRole(String principalId,
List<String> roleIds,
Map<String,String> qualification)
Returns whether the given principal has any of the passed role IDs with the given qualification.
|
boolean |
principalHasRole(String principalId,
List<String> roleIds,
Map<String,String> qualification,
boolean checkDelegations)
Returns whether the given principal has any of the passed role IDs with the given qualification.
|
protected boolean |
putPrincipalHasRoleInCache(boolean principalHasRole,
String principalId,
String roleId,
Map<String,String> qualification,
boolean checkDelegations) |
protected void |
putRoleInCache(Role role) |
void |
removeDelegateMembers(List<DelegateMember> delegateMembers)
Removes existing DelegateMembers.
|
void |
removeGroupFromRole(String groupId,
String namespaceCode,
String roleName,
Map<String,String> qualifier)
Remove the group with the given id and qualifications from the role
with the specified namespace code and role name.
|
void |
removePrincipalFromRole(String principalId,
String namespaceCode,
String roleName,
Map<String,String> qualifier)
Remove the principal with the given id and qualifications from the role
with the specified namespace code and role name.
|
void |
removeRoleFromRole(String roleId,
String namespaceCode,
String roleName,
Map<String,String> qualifier)
Remove the group with the given id and qualifications from the role
with the specified namespace code and role name.
|
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.
|
void |
revokePermissionFromRole(String permissionId,
String roleId)
Removes the given permission to the given role
|
void |
setCacheManager(org.springframework.cache.CacheManager cacheManager)
Sets the cache manager which this service implementation can for internal caching.
|
void |
setDataObjectService(DataObjectService dataObjectService) |
void |
setDateTimeService(DateTimeService dateTimeService) |
void |
setRoleDao(RoleDao roleDao) |
protected void |
updateActionRequestsForRoleResponsibilityActionChange(RoleResponsibilityActionBo bo)
Queues ActionRequest refresh/regeneration for RoleResponsbilityAction change
|
DelegateMember |
updateDelegateMember(DelegateMember delegateMember)
Updates the given delegateMember to the values in the passed in delegateMember
|
DelegateType |
updateDelegateType(DelegateType delegateType)
Updates the given DelegateType to the values in the passed in delegateType
|
Role |
updateRole(Role role)
This will update a
Role . |
RoleMember |
updateRoleMember(RoleMember roleMember)
Updates the given roleMember to the values in the passed in roleMember
|
RoleResponsibilityAction |
updateRoleResponsibilityAction(RoleResponsibilityAction roleResponsibilityAction)
Updates the given RoleResponsibilityAction to the values in the passed in roleResponsibilityAction
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notifyOnMemberRemoval
protected DataObjectService dataObjectService
protected IdentityService identityService
protected NamespaceService namespaceService
protected KimTypeInfoService kimTypeInfoService
protected GroupService groupService
protected ResponsibilityInternalService responsibilityInternalService
protected DateTimeService dateTimeService
public RoleServiceImpl()
public Role createRole(Role role) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
Role
exactly like the role passed in.createRole
in interface RoleService
role
- the role to createRiceIllegalArgumentException
- if the role passed in is nullRiceIllegalStateException
- if the role is already existing in the systempublic Role updateRole(Role role) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
Role
.updateRole
in interface RoleService
role
- the role to updateRiceIllegalArgumentException
- if the role is nullRiceIllegalStateException
- if the role does not exist in the systemprotected boolean checkForCircularRoleMembership(String newMemberId, RoleBo roleBo)
newMemberId
- roleBo
- protected RoleMember findRoleMember(String roleMemberId)
public RoleMemberQueryResults findRoleMembers(QueryByCriteria queryByCriteria) throws RiceIllegalStateException
RoleService
findRoleMembers
in interface RoleService
queryByCriteria
- the qualifications for the roleIds.RiceIllegalStateException
public Set<String> getRoleTypeRoleMemberIds(String roleId) throws RiceIllegalArgumentException
RoleService
getRoleTypeRoleMemberIds
in interface RoleService
roleId
- the role id.RiceIllegalArgumentException
- if roleId is null or blank.public List<String> getMemberParentRoleIds(String memberType, String memberId) throws RiceIllegalStateException
RoleService
getMemberParentRoleIds
in interface RoleService
memberType
- the role member type.memberId
- the role member id (principalId, roleId, groupId).RiceIllegalStateException
public List<RoleResponsibilityAction> getRoleMemberResponsibilityActions(String roleMemberId) throws RiceIllegalStateException
RoleService
getRoleMemberResponsibilityActions
in interface RoleService
roleMemberId
- the role member Id.RiceIllegalStateException
public DelegateMemberQueryResults findDelegateMembers(QueryByCriteria queryByCriteria) throws RiceIllegalStateException
RoleService
findDelegateMembers
in interface RoleService
queryByCriteria
- the qualifications for the roleIds.RiceIllegalStateException
public Role getRole(String roleId) throws RiceIllegalStateException
RoleService
getRole
in interface RoleService
roleId
- the id of the role.RiceIllegalStateException
protected Role loadRole(String roleId)
protected Role getRoleFromCache(String id)
protected Role getRoleFromCache(String namespaceCode, String name)
protected void putRoleInCache(Role role)
protected Map<String,RoleBoLite> getRoleBoLiteMap(Collection<String> roleIds)
public List<Role> getRoles(List<String> roleIds) throws RiceIllegalStateException
RoleService
getRoles
in interface RoleService
roleIds
- the ids of the roles.RiceIllegalStateException
protected List<Role> loadRoles(List<String> roleIds)
public Role getRoleByNamespaceCodeAndName(String namespaceCode, String roleName) throws RiceIllegalStateException
RoleService
getRoleByNamespaceCodeAndName
in interface RoleService
namespaceCode
- the namespace code of the role.roleName
- the name of the role.RiceIllegalStateException
protected Role loadRoleByName(String namespaceCode, String roleName)
public String getRoleIdByNamespaceCodeAndName(String namespaceCode, String roleName) throws RiceIllegalStateException
RoleService
getRoleIdByNamespaceCodeAndName
in interface RoleService
namespaceCode
- the namespace code of the role.roleName
- the name of the role.RiceIllegalStateException
public boolean isRoleActive(String roleId) throws RiceIllegalStateException
RoleService
isRoleActive
in interface RoleService
roleId
- the unique id of a role.RiceIllegalStateException
public List<Map<String,String>> getRoleQualifersForPrincipalByRoleIds(String principalId, List<String> roleIds, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
getRoleQualifersForPrincipalByRoleIds
in interface RoleService
principalId
- the principalId toroleIds
- the namespace code of the role.qualification
- the qualifications for the roleIds.RiceIllegalStateException
public List<Map<String,String>> getRoleQualifersForPrincipalByNamespaceAndRolename(String principalId, String namespaceCode, String roleName, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
getRoleQualifersForPrincipalByNamespaceAndRolename
in interface RoleService
principalId
- the principalId tonamespaceCode
- the namespace code of the role.roleName
- the name of the role.qualification
- the qualifications for the roleIds.RiceIllegalStateException
public List<Map<String,String>> getNestedRoleQualifersForPrincipalByNamespaceAndRolename(String principalId, String namespaceCode, String roleName, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
getNestedRoleQualifersForPrincipalByNamespaceAndRolename
in interface RoleService
principalId
- the principalId tonamespaceCode
- the namespace code of the role.roleName
- the name of the role.qualification
- the qualifications for the roleIds.RiceIllegalStateException
public List<Map<String,String>> getNestedRoleQualifiersForPrincipalByRoleIds(String principalId, List<String> roleIds, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
getNestedRoleQualifiersForPrincipalByRoleIds
in interface RoleService
principalId
- the principalId toroleIds
- the namespace code of the role.qualification
- the qualifications for the roleIds.RiceIllegalStateException
public List<RoleMembership> getRoleMembers(List<String> roleIds, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
getRoleMembers
in interface RoleService
roleIds
- a list of role Ids.qualification
- the qualifications for the roleIds.RiceIllegalStateException
public Collection<String> getRoleMemberPrincipalIds(String namespaceCode, String roleName, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
getRoleMemberPrincipalIds
in interface RoleService
namespaceCode
- the namespace code of the role.roleName
- the name of the rolequalification
- the qualifications for the roleIds.RiceIllegalStateException
public boolean principalHasRole(String principalId, List<String> roleIds, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
principalHasRole
in interface RoleService
principalId
- the principal Id to check.roleIds
- the list of role ids.qualification
- the qualifications for the roleIds.RiceIllegalStateException
public List<String> getPrincipalIdSubListWithRole(List<String> principalIds, String roleNamespaceCode, String roleName, Map<String,String> qualification) throws RiceIllegalStateException
RoleService
getPrincipalIdSubListWithRole
in interface RoleService
principalIds
- the principal Ids to check.roleNamespaceCode
- the namespaceCode of the role.roleName
- the name of the role.qualification
- the qualifications for the roleIds.RiceIllegalStateException
public RoleQueryResults findRoles(QueryByCriteria queryByCriteria) throws RiceIllegalStateException
RoleService
findRoles
in interface RoleService
queryByCriteria
- the qualifications for the roleIds.RiceIllegalStateException
public List<RoleMembership> getFirstLevelRoleMembers(List<String> roleIds) throws RiceIllegalStateException
RoleService
The resulting List of role membership will contain membership for all the roles with the specified ids. The list is not guaranteed to be in any particular order and may have membership info for the different roles interleaved with each other.
getFirstLevelRoleMembers
in interface RoleService
roleIds
- a list of role Ids.RiceIllegalStateException
public RoleMembershipQueryResults findRoleMemberships(QueryByCriteria queryByCriteria) throws RiceIllegalStateException
RoleService
findRoleMemberships
in interface RoleService
queryByCriteria
- the qualifications for the roleIds.RiceIllegalStateException
public List<DelegateMember> getDelegationMembersByDelegationId(String delegationId) throws RiceIllegalStateException
RoleService
getDelegationMembersByDelegationId
in interface RoleService
delegationId
- the delegate id.RiceIllegalStateException
public DelegateMember getDelegationMemberByDelegationAndMemberId(String delegationId, String memberId) throws RiceIllegalStateException
RoleService
getDelegationMemberByDelegationAndMemberId
in interface RoleService
delegationId
- the delegate id.memberId
- the member id matching the DelegateMemberRiceIllegalStateException
public DelegateMember getDelegationMemberById(String delegationMemberId) throws RiceIllegalStateException
RoleService
getDelegationMemberById
in interface RoleService
delegationMemberId
- the member id matching the DelegateMemberRiceIllegalStateException
public List<RoleResponsibility> getRoleResponsibilities(String roleId) throws RiceIllegalStateException
RoleService
getRoleResponsibilities
in interface RoleService
roleId
- the role Id.RiceIllegalStateException
public DelegateType getDelegateTypeByRoleIdAndDelegateTypeCode(String roleId, DelegationType delegationType) throws RiceIllegalStateException
RoleService
getDelegateTypeByRoleIdAndDelegateTypeCode
in interface RoleService
roleId
- the role Id.delegationType
- type of delegationRiceIllegalStateException
public DelegateType getDelegateTypeByDelegationId(String delegationId) throws RiceIllegalStateException
RoleService
getDelegateTypeByDelegationId
in interface RoleService
delegationId
- the id of delegationRiceIllegalStateException
protected List<RoleMembership> getRoleMembers(List<String> roleIds, Map<String,String> qualification, boolean followDelegations, Set<String> foundRoleTypeMembers)
protected List<RoleMembership.Builder> applyDelegationsToRoleMembers(List<RoleMembership> roleMemberships, Collection<DelegateTypeBo> delegations, Map<String,String> qualification)
protected void linkDelegateToRoleMembership(DelegateTypeBo delegation, DelegateMember.Builder delegateMemberBuilder, RoleMembership.Builder roleMembershipBuilder)
protected void resolveDelegationMemberRoles(List<RoleMembership.Builder> membershipBuilders, Map<String,String> qualification, Set<String> foundRoleTypeMembers)
public boolean principalHasRole(String principalId, List<String> roleIds, Map<String,String> qualification, boolean checkDelegations)
RoleService
principalHasRole
in interface RoleService
principalId
- the principal Id to check.roleIds
- the list of role ids.qualification
- the qualifications for the roleIds.checkDelegations
- whether delegations should be checked or notprotected boolean principalHasRole(org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context, String principalId, List<String> roleIds, Map<String,String> qualification, boolean checkDelegations)
protected Boolean getPrincipalHasRoleFromCache(String principalId, String roleId, Map<String,String> qualification, boolean checkDelegations)
protected boolean putPrincipalHasRoleInCache(boolean principalHasRole, String principalId, String roleId, Map<String,String> qualification, boolean checkDelegations)
protected List<String> getQualifiersForExactMatch(String kimTypeId, RoleTypeService roleTypeService)
public boolean isDerivedRoleType(RoleTypeService service)
public boolean isDerivedRole(String roleId)
RoleService
isDerivedRole
in interface RoleService
roleId
- the roleIdpublic boolean isDynamicRoleMembership(String roleId)
RoleService
isDynamicRoleMembership
in interface RoleService
roleId
- the roleIdprotected boolean matchesOnDelegation(Set<String> allRoleIds, String principalId, List<String> principalGroupIds, Map<String,String> qualification, org.kuali.rice.kim.impl.role.RoleServiceImpl.Context context)
protected List<RoleMembership> convertToRoleMemberships(List<RoleMemberBo>... roleMemberLists)
protected boolean getRoleIdToMembershipMap(Map<String,List<RoleMembership>> roleIdToMembershipMap, List<RoleMemberBo> roleMembers)
protected DelegateTypeBo getKimDelegationImpl(String delegationId)
protected DelegationTypeService getDelegationTypeService(String delegationId)
protected Collection<RoleMembership> getNestedRoleMembers(Map<String,String> qualification, RoleMembership rm, Set<String> foundRoleTypeMembers)
protected DelegateMemberBo getKimDelegationMemberImplByDelegationAndId(String delegationId, String delegationMemberId)
public RoleMember assignPrincipalToRole(String principalId, String namespaceCode, String roleName, Map<String,String> qualifier) throws RiceIllegalArgumentException
RoleService
assignPrincipalToRole
in interface RoleService
principalId
- the principalIdnamespaceCode
- the namespaceCode of the RoleroleName
- the name of the rolequalifier
- the qualifications for the principalId to be assigned to the roleRiceIllegalArgumentException
- if princialId, namespaceCode or roleName is null or blank.public RoleMember assignGroupToRole(String groupId, String namespaceCode, String roleName, Map<String,String> qualifier) throws RiceIllegalStateException
RoleService
assignGroupToRole
in interface RoleService
groupId
- the groupIdnamespaceCode
- the namespaceCode of the RoleroleName
- the name of the rolequalifier
- the qualifications for the principalId to be assigned to the roleRiceIllegalStateException
public RoleMember assignRoleToRole(String roleId, String namespaceCode, String roleName, Map<String,String> qualifier) throws RiceIllegalStateException
RoleService
assignRoleToRole
in interface RoleService
roleId
- the roleIdnamespaceCode
- the namespaceCode of the RoleroleName
- the name of the rolequalifier
- the qualifications for the principalId to be assigned to the roleRiceIllegalStateException
public RoleMember createRoleMember(RoleMember roleMember) throws RiceIllegalStateException
RoleService
createRoleMember
in interface RoleService
roleMember
- the new RoleMember to save.RiceIllegalStateException
- if roleMember already exists.public RoleMember updateRoleMember(RoleMember roleMember) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
updateRoleMember
in interface RoleService
roleMember
- the new RoleMember to save.RiceIllegalArgumentException
- if roleMember is null.RiceIllegalStateException
- if roleMember does not yet exist.public DelegateMember updateDelegateMember(DelegateMember delegateMember) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
updateDelegateMember
in interface RoleService
delegateMember
- the new DelegateMember to save.RiceIllegalArgumentException
- if delegateMember is null.RiceIllegalStateException
- if delegateMember does not yet exist.public DelegateMember createDelegateMember(DelegateMember delegateMember) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
createDelegateMember
in interface RoleService
delegateMember
- the new DelegateMember to save.RiceIllegalArgumentException
- if delegateMember is null.RiceIllegalStateException
- if delegateMember already exists.public void removeDelegateMembers(List<DelegateMember> delegateMembers) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
removeDelegateMembers
in interface RoleService
RiceIllegalArgumentException
- if delegateMember is null.RiceIllegalStateException
public RoleResponsibilityAction createRoleResponsibilityAction(RoleResponsibilityAction roleResponsibilityAction) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
createRoleResponsibilityAction
in interface RoleService
roleResponsibilityAction
- the new RoleResponsibilityAction to save.RiceIllegalArgumentException
- if roleResponsibilityAction is null.RiceIllegalStateException
- if roleResponsibilityAction already exists.protected void updateActionRequestsForRoleResponsibilityActionChange(RoleResponsibilityActionBo bo)
bo
- the changed or deleted RoleResponsibilityActionBopublic RoleResponsibilityAction updateRoleResponsibilityAction(RoleResponsibilityAction roleResponsibilityAction) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
updateRoleResponsibilityAction
in interface RoleService
roleResponsibilityAction
- the new RoleResponsibilityAction to save.RiceIllegalArgumentException
- if roleResponsibilityAction is null.RiceIllegalStateException
- if roleResponsibilityAction does not exist.public void deleteRoleResponsibilityAction(String roleResponsibilityActionId) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
deleteRoleResponsibilityAction
in interface RoleService
roleResponsibilityActionId
- id of the RoleResponsibilityAction to delete.RiceIllegalArgumentException
- if roleResponsibilityActionId is null.RiceIllegalStateException
- if roleResponsibilityAction does not exist.public DelegateType createDelegateType(DelegateType delegateType) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
createDelegateType
in interface RoleService
delegateType
- the new DelegateType to save.RiceIllegalArgumentException
- if delegateType is null.RiceIllegalStateException
- if delegateType already exists.public DelegateType updateDelegateType(DelegateType delegateType) throws RiceIllegalArgumentException, RiceIllegalStateException
RoleService
updateDelegateType
in interface RoleService
delegateType
- the new DelegateType to save.RiceIllegalArgumentException
- if delegateType is null.RiceIllegalStateException
- if delegateType does not yet exist.public void removePrincipalFromRole(String principalId, String namespaceCode, String roleName, Map<String,String> qualifier) throws RiceIllegalArgumentException
RoleService
removePrincipalFromRole
in interface RoleService
principalId
- the principalIdnamespaceCode
- the namespaceCode of the RoleroleName
- the name of the rolequalifier
- the qualifications for the principalId to be assigned to the roleRiceIllegalArgumentException
- if principalId, namespaceCode or roleName is null or blank.public void removeGroupFromRole(String groupId, String namespaceCode, String roleName, Map<String,String> qualifier) throws RiceIllegalArgumentException
RoleService
removeGroupFromRole
in interface RoleService
groupId
- the groupIdnamespaceCode
- the namespaceCode of the RoleroleName
- the name of the rolequalifier
- the qualifications for the principalId to be assigned to the roleRiceIllegalArgumentException
- if groupId, namespaceCode or roleName is null or blank.public void removeRoleFromRole(String roleId, String namespaceCode, String roleName, Map<String,String> qualifier) throws RiceIllegalArgumentException
RoleService
removeRoleFromRole
in interface RoleService
roleId
- the roleIdnamespaceCode
- the namespaceCode of the RoleroleName
- the name of the rolequalifier
- the qualifications for the principalId to be assigned to the roleRiceIllegalArgumentException
- if roleId, namespaceCode or roleName is null or blank.public void assignPermissionToRole(String permissionId, String roleId) throws RiceIllegalArgumentException
RoleService
assignPermissionToRole
in interface RoleService
permissionId
- the permissionIdroleId
- the roleIdRiceIllegalArgumentException
- if permissionId or roleId is null or blank.public void revokePermissionFromRole(String permissionId, String roleId) throws RiceIllegalArgumentException
RoleService
revokePermissionFromRole
in interface RoleService
permissionId
- the permissionIdroleId
- the roleIdRiceIllegalArgumentException
- if permissionId or roleId is null or blank.protected void addMemberAttributeData(RoleMemberBo roleMember, Map<String,String> qualifier, String kimTypeId)
protected void addDelegationMemberAttributeData(DelegateMemberBo delegationMember, Map<String,String> qualifier, String kimTypeId)
protected void logPrincipalHasRoleCheck(String principalId, List<String> roleIds, Map<String,String> roleQualifiers)
protected RoleService getProxiedRoleService()
public void setCacheManager(org.springframework.cache.CacheManager cacheManager)
cacheManager
- the cache manager to use for internal caching, must not be nullIllegalArgumentException
- if a null cache manager is passedprotected DataSource getDataSource()
protected org.kuali.rice.kim.impl.role.RoleServiceImpl.VersionedService<RoleTypeService> getVersionedRoleTypeService(KimType typeInfo)
protected Map<String,String> convertQualifierKeys(Map<String,String> qualification, Map<String,String> validAttributeIds)
qualification
- The original role qualification attribute setvalidAttributeIds
- The mapping of attribute names to their matching attribute idsprotected void getNestedRoleTypeMemberIds(String roleId, Set<String> members)
protected List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds, String principalId)
protected List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds, String principalId, Map<String,String> qualification)
protected List<RoleMemberBo> getRoleMembersForGroupIds(String roleId, List<String> groupIds)
protected List<RoleMemberBo> getRoleMemberBoList(RoleServiceBase.RoleDaoAction daoActionToTake, Collection<String> roleIds, String principalId, Collection<String> groupIds, String memberTypeCode, Map<String,String> qualification)
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 setIllegalArgumentException
- if daoActionToTake refers to an enumeration constant that is not role-member-related.public List<RoleMemberBo> getRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds, Collection<String> groupIds, Map<String,String> qualification)
protected List<RoleMemberBo> getRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds, Map<String,String> qualification)
protected List<RoleMemberBo> getRoleMembersForRoleIdsWithFilters(Collection<String> roleIds, String principalId, Collection<String> groupIds, Map<String,String> qualification)
protected List<RoleMemberBo> getRoleMembershipsForPredicates(Collection<Predicate> criteria)
protected Predicate getRoleQualificationPredicate(Map<String,String> qualification)
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.protected List<RoleMemberBo> getRoleMembershipsForMemberId(String memberType, String memberId, Map<String,String> qualification)
protected List<RoleMemberBo> getStoredRolePrincipalsForPrincipalIdAndRoleIds(Collection<String> roleIds, String principalId, Map<String,String> qualification)
protected List<RoleMemberBo> getStoredRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds, Collection<String> groupIds, Map<String,String> qualification)
protected List<RoleMemberBo> getStoredRoleMembersForRoleIds(Collection<String> roleIds, String memberTypeCode, Map<String,String> qualification)
protected List<RoleMemberBo> getStoredRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds, Map<String,String> qualification)
protected List<RoleMemberBo> getStoredRoleMembersForRoleIdsWithFilters(Collection<String> roleIds, String principalId, List<String> groupIds, Map<String,String> qualification)
protected RoleMemberBo getRoleMemberBo(String roleMemberId)
protected RoleResponsibilityActionBo getRoleResponsibilityActionBo(String roleResponsibilityActionId)
protected Map<String,DelegateTypeBo> getStoredDelegationImplMapFromRoleIds(Collection<String> roleIds)
protected List<DelegateTypeBo> getStoredDelegationImplsForRoleIds(Collection<String> roleIds)
protected List<DelegateMemberBo> getStoredDelegationPrincipalsForPrincipalIdAndDelegationIds(Collection<String> delegationIds, String principalId)
protected DelegateMemberBo getDelegateMemberBo(String delegationMemberId)
protected List<DelegateMemberBo> getDelegationMemberBoListByMemberAndDelegationId(String memberId, String delegationId)
protected String getMemberName(Object member)
protected RoleBoLite getRoleBoLite(String roleId)
protected DelegateTypeBo getDelegationOfType(String roleId, DelegationType delegationType)
protected DelegateTypeBo getPrimaryDelegation(String roleId, List<DelegateTypeBo> roleDelegates)
protected RoleMemberBo matchingMemberRecord(List<RoleMemberBo> roleMembers, String memberId, String memberTypeCode, Map<String,String> qualifier)
protected boolean isDelegationPrimary(DelegationType delegationType)
protected boolean isDelegationSecondary(DelegationType delegationType)
protected RoleBo getRoleBoByName(String namespaceCode, String roleName)
protected RoleBoLite getRoleBoLiteByName(String namespaceCode, String roleName)
protected List<RoleMember> doAnyMemberRecordsMatchByExactQualifier(RoleEbo role, String memberId, RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
protected List<RoleMemberBo> getRoleMembersByExactQualifierMatch(RoleEbo role, String memberId, RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
protected RoleMember doAnyMemberRecordsMatch(List<RoleMemberBo> roleMembers, String memberId, String memberTypeCode, Map<String,String> qualifier)
protected boolean doesMemberMatch(RoleMemberBo roleMember, String memberId, String memberTypeCode, Map<String,String> qualifier)
protected RoleTypeService getRoleTypeService(String roleId)
roleId
- the role ID to get the role type service forprotected RoleTypeService getRoleTypeServiceByName(String serviceName)
serviceName
- the name of the service to retrieveprotected RoleTypeService getRoleTypeService(KimType typeInfo)
protected Map<String,String> populateQualifiersForExactMatch(Map<String,String> defaultQualification, List<String> attributes)
protected String getKimAttributeId(String kimTypeId, String attributeName)
protected Collection<KimAttributeBo> getAttributeByName(String attributeName)
protected String getCorrectAttributeId(String kimTypeId, String attributeName, Collection<KimAttributeBo> attributeData)
protected String getAttributeFromKimType(KimType kimType, String attributeName)
protected String getAttributeFromNamespace(KimType kimType, String attributeName, Collection<KimAttributeBo> attributes)
protected String getAppIdFromNamespace(String namespaceCode)
protected String getAttributeFromAppId(Collection<KimAttributeBo> attributes, String appId)
protected KimTypeInfoService getKimTypeInfoService()
protected NamespaceService getNamespaceService()
protected IdentityService getIdentityService()
protected GroupService getGroupService()
protected ResponsibilityInternalService getResponsibilityInternalService()
protected RoleDao getRoleDao()
public void setRoleDao(RoleDao roleDao)
public DataObjectService getDataObjectService()
public void setDataObjectService(DataObjectService dataObjectService)
public DateTimeService getDateTimeService()
public void setDateTimeService(DateTimeService dateTimeService)
public void notifyOnMemberRemoval(RoleMember member)
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.