use of org.springframework.ldap.core.DirContextOperations in project perun by CESNET.
the class PerunResourceImpl method synchronizeGroups.
@Override
public void synchronizeGroups(Resource resource, List<Group> assignedGroups) {
DirContextOperations entry = findByDN(buildDN(resource));
doSynchronizeGroups(entry, assignedGroups);
ldapTemplate.modifyAttributes(entry);
}
use of org.springframework.ldap.core.DirContextOperations in project perun by CESNET.
the class PerunVOImpl method addMemberToVO.
@Override
public void addMemberToVO(int voId, Member member) {
DirContextOperations voEntry = findById(String.valueOf(voId));
Name memberDN = user.getEntryDN(String.valueOf(member.getUserId()));
voEntry.addAttributeValue(PerunAttribute.PerunAttributeNames.ldapAttrUniqueMember, addBaseDN(memberDN).toString());
ldapTemplate.modifyAttributes(voEntry);
DirContextOperations userEntry = findByDN(memberDN);
userEntry.addAttributeValue(PerunAttribute.PerunAttributeNames.ldapAttrMemberOfPerunVo, String.valueOf(voId));
ldapTemplate.modifyAttributes(userEntry);
}
use of org.springframework.ldap.core.DirContextOperations in project perun by CESNET.
the class PerunVOImpl method removeMemberFromVO.
@Override
public void removeMemberFromVO(int voId, Member member) {
DirContextOperations voEntry = findById(String.valueOf(voId));
Name memberDN = user.getEntryDN(String.valueOf(member.getUserId()));
voEntry.removeAttributeValue(PerunAttribute.PerunAttributeNames.ldapAttrUniqueMember, addBaseDN(memberDN).toString());
ldapTemplate.modifyAttributes(voEntry);
DirContextOperations userEntry = findByDN(memberDN);
userEntry.removeAttributeValue(PerunAttribute.PerunAttributeNames.ldapAttrMemberOfPerunVo, String.valueOf(voId));
ldapTemplate.modifyAttributes(userEntry);
}
use of org.springframework.ldap.core.DirContextOperations in project perun by CESNET.
the class PerunUserImpl method removeFromGroupAdmins.
@Override
public void removeFromGroupAdmins(User user, Group group) {
DirContextOperations entry = findByDN(buildDN(user));
Name groupDN = addBaseDN(perunGroup.getEntryDN(String.valueOf(group.getVoId()), String.valueOf(group.getId())));
entry.removeAttributeValue(PerunAttribute.PerunAttributeNames.ldapAttrAdminOfGroup, groupDN.toString());
ldapTemplate.modifyAttributes(entry);
}
use of org.springframework.ldap.core.DirContextOperations in project perun by CESNET.
the class PerunUserImpl method addPrincipal.
@Override
public void addPrincipal(User user, String login) {
DirContextOperations entry = findByDN(buildDN(user));
if (isEppnEpuidLogin(login)) {
entry.addAttributeValue(PerunAttribute.PerunAttributeNames.ldapAttrEduPersonPrincipalNames, login);
}
entry.addAttributeValue(PerunAttribute.PerunAttributeNames.ldapAttrUserIdentities, login);
ldapTemplate.modifyAttributes(entry);
}
Aggregations