diff --git a/guacamole/src/main/webapp/app/navigation/directives/guacPageList.js b/guacamole/src/main/webapp/app/navigation/directives/guacPageList.js index ef2b05e61..cc4d8fb13 100644 --- a/guacamole/src/main/webapp/app/navigation/directives/guacPageList.js +++ b/guacamole/src/main/webapp/app/navigation/directives/guacPageList.js @@ -138,7 +138,7 @@ angular.module('navigation').directive('guacPageList', [function guacPageList() name : name, url : isCurrentPage ? currentURL : page.url, className : page.className, - weight : page.weight || weight + weight : page.weight || (weight + i) }); } diff --git a/guacamole/src/main/webapp/app/navigation/services/userPageService.js b/guacamole/src/main/webapp/app/navigation/services/userPageService.js index 782f3fce7..257f4112a 100644 --- a/guacamole/src/main/webapp/app/navigation/services/userPageService.js +++ b/guacamole/src/main/webapp/app/navigation/services/userPageService.js @@ -53,6 +53,14 @@ angular.module('navigation').factory('userPageService', ['$injector', url : '/' }); + /** + * The identifiers of all data sources currently available to the + * authenticated user. + * + * @type String[] + */ + var dataSources = authenticationService.getAvailableDataSources(); + /** * Returns an appropriate home page for the current user. * @@ -176,9 +184,10 @@ angular.module('navigation').factory('userPageService', ['$injector', var canManageSessions = []; // Inspect the contents of each provided permission set - angular.forEach(permissionSets, function inspectPermissions(permissions, dataSource) { + angular.forEach(dataSources, function inspectPermissions(dataSource) { - permissions = angular.copy(permissions); + // Copy permissions for current data source + var permissions = angular.copy(permissionSets[dataSource]); // Ignore permission to update root group PermissionSet.removeConnectionGroupPermission(permissions,