From e7af75ceedfb24b97bc9341b6568703a0a778a12 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 11 Mar 2015 00:16:09 -0700 Subject: [PATCH] GUAC-1118: Do not include self in list of users in management UI. --- .../app/manage/controllers/manageController.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageController.js b/guacamole/src/main/webapp/app/manage/controllers/manageController.js index ab8ef457c..f757234c5 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageController.js @@ -38,6 +38,9 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', var permissionService = $injector.get('permissionService'); var userService = $injector.get('userService'); + // Identifier of the current user + var currentUserID = authenticationService.getCurrentUserID(); + /** * An action to be provided along with the object sent to showStatus which * closes the currently-shown status dialog. @@ -132,7 +135,7 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', }; // Retrieve current permissions - permissionService.getPermissions(authenticationService.getCurrentUserID()) + permissionService.getPermissions(currentUserID) .success(function permissionsRetrieved(permissions) { // Ignore permission to update root group @@ -189,7 +192,12 @@ angular.module('manage').controller('manageController', ['$scope', '$injector', userService.getUsers([PermissionSet.ObjectPermissionType.UPDATE, PermissionSet.ObjectPermissionType.DELETE]) .success(function usersReceived(users) { - $scope.users = users; + + // Display only other users, not self + $scope.users = users.filter(function isNotSelf(user) { + return user.username !== currentUserID; + }); + }); /**