fix(plugin-authentication): CB-416 user editing login check

This commit is contained in:
Wroud
2020-10-13 15:43:23 +03:00
parent 83be5f7178
commit 023eeda045
@@ -143,19 +143,21 @@ export class UserFormController implements IInitializableController, IDestructib
};
private validate() {
if (!this.credentials.login.trim()) {
this.notificationService.logError({ title: 'authentication_user_login_not_set' });
return;
}
if (!this.editing) {
if (!this.credentials.login.trim()) {
this.notificationService.logError({ title: 'authentication_user_login_not_set' });
return;
}
if (this.rolesManagerService.roles.has(this.credentials.login)) {
this.notificationService.logError({ title: 'authentication_user_login_cant_be_used' });
return;
}
if (this.rolesManagerService.roles.has(this.credentials.login)) {
this.notificationService.logError({ title: 'authentication_user_login_cant_be_used' });
return;
}
if (this.usersResource.has(this.credentials.login)) {
this.notificationService.logError({ title: 'authentication_user_login_already_exists' });
return;
if (this.usersResource.has(this.credentials.login)) {
this.notificationService.logError({ title: 'authentication_user_login_already_exists' });
return;
}
}
if (!this.isRoleSelected()) {