Merge pull request #139 from glyptodon/GUAC-1126-hide-home-connection

GUAC-1126 Don't show the home page in user menu if it's not the default.
This commit is contained in:
Mike Jumper
2015-04-08 21:23:35 -07:00

View File

@@ -56,6 +56,17 @@ angular.module('navigation').factory('userPageService', ['$injector',
this.url = url; 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. * 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 // Resolve promise with default home page
return new Page( return SYSTEM_HOME_PAGE;
'USER_MENU.ACTION_NAVIGATE_HOME',
'/'
);
}; };
@@ -195,8 +203,11 @@ angular.module('navigation').factory('userPageService', ['$injector',
// A user must be a system administrator to manage sessions // A user must be a system administrator to manage sessions
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER); PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER);
// Add home page // Only include the home page in the list of main pages if the user
pages.push(generateHomePage(rootGroup)); // 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 user can manage users, add link to user management page
if (canManageUsers) { if (canManageUsers) {