use of org.kuali.kfs.kim.impl.role.Role in project cu-kfs by CU-CommunityApps.
the class IdentityManagementRoleDocument method initializeMinimalRoleBoForDelegationMember.
protected void initializeMinimalRoleBoForDelegationMember(RoleDocumentDelegationMember delegationMember) {
Role role = delegationMember.getMemberRole();
if (ObjectUtils.isNull(role)) {
role = new Role();
}
role.setId(getRoleId());
role.setKimTypeId(getRoleTypeId());
delegationMember.setMemberRole(role);
}
use of org.kuali.kfs.kim.impl.role.Role in project cu-kfs by CU-CommunityApps.
the class CuUiDocumentServiceImpl method setMembersInDocument.
/**
* Overridden to allow for loading unmodified role members even when there are no delegations,
* and to create a copy of the RoleBo's members list (to prevent potential member auto-deletion).
*/
@Override
public void setMembersInDocument(IdentityManagementRoleDocument identityManagementRoleDocument) {
Map<String, String> criteria = new HashMap<>();
criteria.put(KimConstants.PrimaryKeyConstants.ROLE_ID, identityManagementRoleDocument.getRoleId());
Role roleBo = getBusinessObjectService().findByPrimaryKey(Role.class, criteria);
List<RoleMember> members = new ArrayList<>(roleBo.getMembers());
List<RoleMember> membersToRemove = new ArrayList<>();
boolean found = false;
for (KimDocumentRoleMember modifiedMember : identityManagementRoleDocument.getModifiedMembers()) {
for (RoleMember member : members) {
if (modifiedMember.getRoleMemberId().equals(member.getId())) {
membersToRemove.add(member);
found = true;
}
if (found) {
break;
}
}
}
for (RoleMember memberToRemove : membersToRemove) {
members.remove(memberToRemove);
}
identityManagementRoleDocument.setMembers(loadRoleMembers(identityManagementRoleDocument, members));
loadMemberRoleRspActions(identityManagementRoleDocument);
}
Aggregations