GUACAMOLE-360: Allow all users access to the session management page.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/3eda3135
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/3eda3135
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/3eda3135

Branch: refs/heads/master
Commit: 3eda313519d73aa1c4235acc78f48bfca3e703a1
Parents: 984ab48
Author: Nick Couchman <[email protected]>
Authored: Tue Jun 12 09:43:16 2018 -0400
Committer: Nick Couchman <[email protected]>
Committed: Wed Jun 13 06:17:52 2018 -0400

----------------------------------------------------------------------
 .../app/navigation/services/userPageService.js  | 27 +++++++++-----------
 1 file changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/3eda3135/guacamole/src/main/webapp/app/navigation/services/userPageService.js
----------------------------------------------------------------------
diff --git 
a/guacamole/src/main/webapp/app/navigation/services/userPageService.js 
b/guacamole/src/main/webapp/app/navigation/services/userPageService.js
index 4d1e612..27ae4d7 100644
--- a/guacamole/src/main/webapp/app/navigation/services/userPageService.js
+++ b/guacamole/src/main/webapp/app/navigation/services/userPageService.js
@@ -71,10 +71,10 @@ angular.module('navigation').factory('userPageService', 
['$injector',
         var settingsPages = generateSettingsPages(permissions);
 
         // If user has access to settings pages, return home page and skip
-        // evaluation for automatic connections.  The Preferences page is
-        // a Settings page and is always visible, so we look for more than
-        // one to indicate access to administrative pages.
-        if (settingsPages.length > 1)
+        // evaluation for automatic connections.  The Preferences and Session
+        // Management pages are "Settings" pages and are always visible, so
+        // we look for more than two to indicate access to administrative 
pages.
+        if (settingsPages.length > 2)
             return SYSTEM_HOME_PAGE;
 
         // Determine whether a connection or balancing group should serve as
@@ -257,25 +257,16 @@ angular.module('navigation').factory('userPageService', 
['$injector',
                 canManageConnections.push(dataSource);
             }
 
-            // Determine whether the current user needs access to the session 
management UI or view connection history
+            // Determine whether the current user needs access to view 
connection history
             if (
-                    // A user must be a system administrator to manage sessions
+                    // A user must be a system administrator to view 
connection records
                     PermissionSet.hasSystemPermission(permissions, 
PermissionSet.SystemPermissionType.ADMINISTER)
             ) {
-                canManageSessions.push(dataSource);
                 canViewConnectionRecords.push(dataSource);
             }
 
         });
 
-        // If user can manage sessions, add link to sessions management page
-        if (canManageSessions.length) {
-            pages.push(new PageDefinition({
-                name : 'USER_MENU.ACTION_MANAGE_SESSIONS',
-                url  : '/settings/sessions'
-            }));
-        }
-
         // If user can manage connections, add links for connection management 
pages
         angular.forEach(canViewConnectionRecords, function 
addConnectionHistoryLink(dataSource) {
             pages.push(new PageDefinition({
@@ -306,6 +297,12 @@ angular.module('navigation').factory('userPageService', 
['$injector',
             }));
         });
 
+        // Add link to session management (always accessible)
+        pages.push(new PageDefinition({
+            name : 'USER_MENU.ACTION_MANAGE_SESSIONS',
+            url  : '/settings/sessions'
+        }));
+
         // Add link to user preferences (always accessible)
         pages.push(new PageDefinition({
             name : 'USER_MENU.ACTION_MANAGE_PREFERENCES',

Reply via email to