Merge branch 'dmp-refactoring' into languages-fixes

This commit is contained in:
CITE\spapacharalampous 2024-09-10 17:48:01 +03:00
commit 17afe9e1ce
3 changed files with 9 additions and 2 deletions

View File

@ -538,4 +538,10 @@ public class ErrorThesaurusProperties {
public void setMissingGlobalRole(ErrorDescription missingGlobalRole) { public void setMissingGlobalRole(ErrorDescription missingGlobalRole) {
this.missingGlobalRole = missingGlobalRole; this.missingGlobalRole = missingGlobalRole;
} }
private ErrorDescription userProfileInactive;
public ErrorDescription getUserProfileInactive() { return userProfileInactive; }
public void setUserProfileInactive(ErrorDescription userProfileInactive) {this.userProfileInactive = userProfileInactive; }
} }

View File

@ -351,9 +351,9 @@ public class UserServiceImpl implements UserService {
List<UserCredentialEntity> userCredentials = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(data.getId()).collect(); List<UserCredentialEntity> userCredentials = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(data.getId()).collect();
if (userCredentials.isEmpty()) if (userCredentials.isEmpty())
throw new MyApplicationException("Currently cannot update roles for this user"); throw new MyApplicationException(this.errors.getUserProfileInactive().getCode(), this.errors.getUserProfileInactive().getMessage());
if (userCredentials.getFirst().getExternalId() == null) if (userCredentials.getFirst().getExternalId() == null)
throw new MyApplicationException("Currently cannot update roles for this user"); throw new MyApplicationException(this.errors.getUserProfileInactive().getCode(), this.errors.getUserProfileInactive().getMessage());
if (!model.getHasTenantAdminMode()) this.applyGlobalRoles(data.getId(), model); if (!model.getHasTenantAdminMode()) this.applyGlobalRoles(data.getId(), model);

View File

@ -55,6 +55,7 @@ export enum ResponseErrorCode {
planBlueprintImportDraft = 157, planBlueprintImportDraft = 157,
missingTenantRole = 158, missingTenantRole = 158,
missingGlobalRole = 159, missingGlobalRole = 159,
userProfileInactive = 160,
// Notification & Annotation Errors // Notification & Annotation Errors
InvalidApiKey = 200, InvalidApiKey = 200,