mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 22:15:26 +00:00
Bug 5080: added meta permission check when adding a user to a user group
to UserManagementServiceImpl
This commit is contained in:
1 parent
aa56707ba6
commit
647f001ea1
1 file changed
+7
-1
+7
-1
@@ -391,7 +391,13 @@ public class UserManagementServiceImpl extends RemoteServiceServlet implements U
|
||||
if (userByName == null) {
|
||||
throw new UserManagementException("user '" + username + "' not found.");
|
||||
}
|
||||
getSecurityService().addUserToUserGroup(tenant, userByName);
|
||||
if (getSecurityService().hasCurrentUserMetaPermissionsOfRoleDefinitionsWithQualification(
|
||||
tenant.getRoleDefinitionMap().keySet(), new Ownership(null, tenant))) {
|
||||
getSecurityService().addUserToUserGroup(tenant, userByName);
|
||||
} else {
|
||||
throw new UnauthorizedException(
|
||||
"Current user does not have all the meta permissions of the user group the user would be added to");
|
||||
}
|
||||
} else {
|
||||
throw new UnauthorizedException("Not permitted to add user to group");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user