Skip to content
Snippets Groups Projects
Commit 8d39c5f3 authored by srosse's avatar srosse
Browse files

OO-3436: if the admin user is not configured or doesn't exist, do nothing but...

OO-3436: if the admin user is not configured or doesn't exist, do nothing but write a message in log
parent ff8b5245
No related branches found
No related tags found
No related merge requests found
......@@ -192,8 +192,12 @@ public class BusinessGroupServiceImpl implements BusinessGroupService, UserDataD
businessGroupRelationDAO.removeRole(identity, businessGroup, GroupRoles.coach.name());
if (businessGroupRelationDAO.countRoles(businessGroup, GroupRoles.coach.name()) == 0) {
Identity admin = deletionManager.getAdminUserIdentity();
businessGroupRelationDAO.addRole(admin, businessGroup, GroupRoles.coach.name());
log.info("Delete user-data, add Administrator-identity as owner of businessGroup=" + businessGroup.getName());
if(admin == null) {
log.info("Delete user-data, cannot add Administrator-identity as owner of businessGroup=" + businessGroup.getName() + ". Businesgroup is orphan");
} else {
businessGroupRelationDAO.addRole(admin, businessGroup, GroupRoles.coach.name());
log.info("Delete user-data, add Administrator-identity as owner of businessGroup=" + businessGroup.getName());
}
}
}
log.debug("Remove owner identity=" + identity + " from " + ownerGroups.size() + " groups");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment