From 543a960ca2d317fb572f71d9533cb3543fc4c4d3 Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Fri, 21 Apr 2017 18:27:32 +0800 Subject: [PATCH] Allow admin to change password when auth mode is 'ldap_auth' --- src/ui_ng/src/app/base/navigator/navigator.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui_ng/src/app/base/navigator/navigator.component.ts b/src/ui_ng/src/app/base/navigator/navigator.component.ts index 0800638e5..6542adb8c 100644 --- a/src/ui_ng/src/app/base/navigator/navigator.component.ts +++ b/src/ui_ng/src/app/base/navigator/navigator.component.ts @@ -93,9 +93,10 @@ export class NavigatorComponent implements OnInit { } public get canChangePassword(): boolean { - return this.session.getCurrentUser() && - this.appConfigService.getConfig() && - this.appConfigService.getConfig().auth_mode != 'ldap_auth'; + let user = this.session.getCurrentUser(); + let config = this.appConfigService.getConfig(); + + return user && ((config && config.auth_mode != 'ldap_auth') || (user.user_id === 1 && user.username === 'admin')); } matchLang(lang: string): boolean {