use of org.olat.basesecurity.SecurityGroupMembershipImpl in project OpenOLAT by OpenOLAT.
the class OLATUpgrade_10_0_0 method processSecurityGroup.
private void processSecurityGroup(Group group, String role, SecurityGroup secGroup) {
if (secGroup == null)
return;
List<SecurityGroupMembershipImpl> oldMemberships = getMembershipsOfSecurityGroup(secGroup);
for (SecurityGroupMembershipImpl oldMembership : oldMemberships) {
GroupMembershipImpl membership = new GroupMembershipImpl();
membership.setCreationDate(oldMembership.getCreationDate());
membership.setLastModified(oldMembership.getLastModified());
membership.setGroup(group);
membership.setIdentity(oldMembership.getIdentity());
membership.setRole(role);
dbInstance.getCurrentEntityManager().persist(membership);
Set<GroupMembership> members = ((GroupImpl) group).getMembers();
if (members == null) {
members = new HashSet<>();
((GroupImpl) group).setMembers(members);
}
members.add(membership);
}
}
use of org.olat.basesecurity.SecurityGroupMembershipImpl in project openolat by klemens.
the class OLATUpgrade_10_0_0 method processSecurityGroup.
private void processSecurityGroup(Group group, String role, SecurityGroup secGroup) {
if (secGroup == null)
return;
List<SecurityGroupMembershipImpl> oldMemberships = getMembershipsOfSecurityGroup(secGroup);
for (SecurityGroupMembershipImpl oldMembership : oldMemberships) {
GroupMembershipImpl membership = new GroupMembershipImpl();
membership.setCreationDate(oldMembership.getCreationDate());
membership.setLastModified(oldMembership.getLastModified());
membership.setGroup(group);
membership.setIdentity(oldMembership.getIdentity());
membership.setRole(role);
dbInstance.getCurrentEntityManager().persist(membership);
Set<GroupMembership> members = ((GroupImpl) group).getMembers();
if (members == null) {
members = new HashSet<>();
((GroupImpl) group).setMembers(members);
}
members.add(membership);
}
}
Aggregations