use of org.kuali.kfs.kim.impl.common.delegate.DelegateMember in project cu-kfs by CU-CommunityApps.
the class PersonImpl method populateDelegateMembers.
private void populateDelegateMembers() {
Map<String, String> criteria = new HashMap<>(2);
criteria.put(KIMPropertyConstants.DelegationMember.MEMBER_ID, principalId);
criteria.put(KIMPropertyConstants.DelegationMember.MEMBER_TYPE_CODE, MemberType.PRINCIPAL.getCode());
delegateMembers = (List<DelegateMember>) getBusinessObjectService().findMatching(DelegateMember.class, criteria);
criteria.clear();
for (DelegateMember dmb : delegateMembers) {
criteria.put(KIMPropertyConstants.Delegation.DELEGATION_ID, dmb.getDelegationId());
DelegateType delegate = getBusinessObjectService().findByPrimaryKey(DelegateType.class, criteria);
dmb.setDelegationType(delegate.getDelegationTypeCode());
}
}
use of org.kuali.kfs.kim.impl.common.delegate.DelegateMember in project cu-kfs by CU-CommunityApps.
the class RoleServiceImpl method resolveDelegationMemberRoles.
/**
* 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.
*/
protected void resolveDelegationMemberRoles(List<RoleMembership.Builder> membershipBuilders, Map<String, String> qualification, Set<String> foundRoleTypeMembers) {
// check delegations assigned to this role
for (RoleMembership.Builder roleMembership : membershipBuilders) {
// this code examines those delegations and obtains the member groups and principals
for (DelegateType delegation : roleMembership.getDelegates()) {
List<DelegateMember> newMembers = new ArrayList<>();
for (DelegateMember member : delegation.getMembers()) {
if (MemberType.ROLE.equals(member.getType())) {
// loop over delegation roles and extract the role IDs where the qualifications match
Collection<RoleMembership> delegateMembers = getRoleMembers(Collections.singletonList(member.getMemberId()), qualification, false, foundRoleTypeMembers);
// loop over the role members and create the needed DelegationMember builders
for (RoleMembership rmi : delegateMembers) {
DelegateMember delegateMember = new DelegateMember();
KimCommonUtilsInternal.copyProperties(delegateMember, member);
delegateMember.setMemberId(rmi.getMemberId());
delegateMember.setType(rmi.getType());
newMembers.add(delegateMember);
}
} else {
newMembers.add(member);
}
}
delegation.setDelegationMembers(newMembers);
}
}
}
Aggregations