From c6323503d86520d0d261baea5a9cbe516f1c8dc9 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 12 Aug 2016 13:55:59 -0700 Subject: [PATCH] GUACAMOLE-78: Do not display user menu for anonymous users. --- .../app/navigation/directives/guacUserMenu.js | 13 ++++++++++++- .../app/navigation/templates/guacUserMenu.html | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js index 249f21701..f94d006c7 100644 --- a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js +++ b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js @@ -68,7 +68,18 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu() .then(function retrievedMainPages(pages) { $scope.pages = pages; }); - + + /** + * Returns whether the current user has authenticated anonymously. + * + * @returns {Boolean} + * true if the current user has authenticated anonymously, false + * otherwise. + */ + $scope.isAnonymous = function isAnonymous() { + return authenticationService.isAnonymous(); + }; + /** * Logs out the current user, redirecting them to back to the root * after logout completes. diff --git a/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html b/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html index 351da0f2c..4ffd937ca 100644 --- a/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html +++ b/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html @@ -1,4 +1,4 @@ -
+