small fix
This commit is contained in:
parent
fad3f394a0
commit
3282b52b39
|
@ -337,14 +337,10 @@ public class UserServiceImpl implements UserService {
|
||||||
if (!model.getHasTenantAdminMode()) {
|
if (!model.getHasTenantAdminMode()) {
|
||||||
this.authorizationService.authorizeForce(Permission.EditUser);
|
this.authorizationService.authorizeForce(Permission.EditUser);
|
||||||
boolean foundGlobalRole = false;
|
boolean foundGlobalRole = false;
|
||||||
boolean foundTenantRole = false;
|
|
||||||
for (String role: model.getRoles()) {
|
for (String role: model.getRoles()) {
|
||||||
if (authorizationConfiguration.getAuthorizationProperties().getAllowedGlobalRoles().contains(role)) foundGlobalRole = true;
|
if (authorizationConfiguration.getAuthorizationProperties().getAllowedGlobalRoles().contains(role)) foundGlobalRole = true;
|
||||||
if (authorizationConfiguration.getAuthorizationProperties().getAllowedTenantRoles().contains(role)) foundTenantRole = true;
|
|
||||||
}
|
}
|
||||||
if (!foundGlobalRole && !foundTenantRole) throw new MyValidationException("Wrong role type");
|
|
||||||
if (!foundGlobalRole) throw new MyValidationException(this.errors.getMissingGlobalRole().getCode(), this.errors.getMissingGlobalRole().getMessage());
|
if (!foundGlobalRole) throw new MyValidationException(this.errors.getMissingGlobalRole().getCode(), this.errors.getMissingGlobalRole().getMessage());
|
||||||
if (!foundTenantRole) throw new MyValidationException(this.errors.getMissingTenantRole().getCode(), this.errors.getMissingTenantRole().getMessage());
|
|
||||||
} else {
|
} else {
|
||||||
this.authorizationService.authorizeForce(Permission.EditTenantUserRole);
|
this.authorizationService.authorizeForce(Permission.EditTenantUserRole);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue