From aa4bfb4f5182c5b5f16b030bb2eaeff8819033de Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 21 Sep 2017 07:53:23 +0200 Subject: [PATCH] change password permission --- client/client/src/web-access/web-access.html | 2 +- client/client/src/web-access/web-access.js | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/client/client/src/web-access/web-access.html b/client/client/src/web-access/web-access.html index 8ada80b627..7d7cc4f923 100644 --- a/client/client/src/web-access/web-access.html +++ b/client/client/src/web-access/web-access.html @@ -15,7 +15,7 @@ - + { + this.canChangePassword = (res.data && res.data.length) ? res.data[0].isCustomer : false; + }); + } else { + this.canChangePassword = false; + } } onPassOpen() { this.newPassword = ''; @@ -16,7 +29,7 @@ export default class Controller { this.$.$apply(); } onPassChange(response) { - if (response == 'ACCEPT') + if (response == 'ACCEPT' && this.canChangePassword) try { if (!this.newPassword) throw new Error(`Passwords can't be empty`);