added common error
This commit is contained in:
parent
1f9aaf616e
commit
76a7b9572d
|
@ -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; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue