From 0736a404c90920f7950ff485d98d3b842357323d Mon Sep 17 00:00:00 2001 From: sujeethk Date: Sat, 1 Oct 2016 15:17:15 -0400 Subject: [PATCH] fix(user): hide delete button for self (#1535) Remove delete button for self Fixes #1531 --- .../users/client/controllers/admin/user.client.controller.js | 5 +++++ modules/users/client/views/admin/view-user.client.view.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/users/client/controllers/admin/user.client.controller.js b/modules/users/client/controllers/admin/user.client.controller.js index 197a44eef1..8c4a1bb04b 100644 --- a/modules/users/client/controllers/admin/user.client.controller.js +++ b/modules/users/client/controllers/admin/user.client.controller.js @@ -14,6 +14,7 @@ vm.user = user; vm.remove = remove; vm.update = update; + vm.isContextUserSelf = isContextUserSelf; function remove(user) { if ($window.confirm('Are you sure you want to delete this user?')) { @@ -46,5 +47,9 @@ vm.error = errorResponse.data.message; }); } + + function isContextUserSelf() { + return vm.user.username === vm.authentication.user.username; + } } }()); diff --git a/modules/users/client/views/admin/view-user.client.view.html b/modules/users/client/views/admin/view-user.client.view.html index 2ab3272884..3b947f2fb9 100644 --- a/modules/users/client/views/admin/view-user.client.view.html +++ b/modules/users/client/views/admin/view-user.client.view.html @@ -8,7 +8,7 @@

- +