From f6fd9f0ff716b1a14063ac8d9d8de20fad26a29d Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 8 Apr 2015 21:17:58 -0700 Subject: [PATCH] GUAC-1126 Don't show the home page in user menu if it's not the default. --- .../navigation/services/userPageService.js | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/guacamole/src/main/webapp/app/navigation/services/userPageService.js b/guacamole/src/main/webapp/app/navigation/services/userPageService.js index 90e6710a4..792c55045 100644 --- a/guacamole/src/main/webapp/app/navigation/services/userPageService.js +++ b/guacamole/src/main/webapp/app/navigation/services/userPageService.js @@ -55,6 +55,17 @@ angular.module('navigation').factory('userPageService', ['$injector', this.name = name; this.url = url; }; + + /** + * The home page to assign to a user if they can navigate to more than one + * page. + * + * @type Page + */ + var SYSTEM_HOME_PAGE = new Page( + 'USER_MENU.ACTION_NAVIGATE_HOME', + '/' + ); /** * Returns an appropriate home page for the current user. @@ -100,10 +111,7 @@ angular.module('navigation').factory('userPageService', ['$injector', } // Resolve promise with default home page - return new Page( - 'USER_MENU.ACTION_NAVIGATE_HOME', - '/' - ); + return SYSTEM_HOME_PAGE; }; @@ -195,8 +203,11 @@ angular.module('navigation').factory('userPageService', ['$injector', // A user must be a system administrator to manage sessions PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER); - // Add home page - pages.push(generateHomePage(rootGroup)); + // Only include the home page in the list of main pages if the user + // can navigate elsewhere. + var homePage = generateHomePage(rootGroup); + if (homePage === SYSTEM_HOME_PAGE) + pages.push(homePage); // If user can manage users, add link to user management page if (canManageUsers) {