From 023eeda045707dd328e1bb6731d4bb41f00bde30 Mon Sep 17 00:00:00 2001 From: Wroud Date: Tue, 13 Oct 2020 15:43:23 +0300 Subject: [PATCH] fix(plugin-authentication): CB-416 user editing login check --- .../Users/UserForm/UserFormController.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/webapp/packages/plugin-authentication/src/Administration/Users/UserForm/UserFormController.ts b/webapp/packages/plugin-authentication/src/Administration/Users/UserForm/UserFormController.ts index c9ccfc9983..5c2d90ebff 100644 --- a/webapp/packages/plugin-authentication/src/Administration/Users/UserForm/UserFormController.ts +++ b/webapp/packages/plugin-authentication/src/Administration/Users/UserForm/UserFormController.ts @@ -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()) {