if (!authorizationsession.isAuthorizedNoLog(administrator, AccessRulesConstants.REGULAR_EDITADMINISTRATORPRIVILEDGES)) {
Authorizer.throwAuthorizationException(administrator, AccessRulesConstants.REGULAR_EDITADMINISTRATORPRIVILEDGES, null);
}
// Authorized to group
if (!authorizationsession.isAuthorizedToGroup(administrator, admingroup)) {
throw new AuthorizationDeniedException("Admin " + administrator + " not authorized to group "
+ admingroup);
}
// Check if admin group is among available admin groups
boolean exists = false;
for(AdminGroup next : getAdminGroupNames()) {
if (next.getAdminGroupName().equals(admingroup)) {
exists = true;
}
}
if (!exists) {
if(log.isDebugEnabled()) {
log.debug("Admingroup " + admingroup + " not among authorized admingroups.");
}
throw new AuthorizationDeniedException("Admingroup " + admingroup + " not among authorized admingroups.");
}
}