mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	GUACAMOLE-360: Make session management page always available.
This commit is contained in:
		| @@ -72,9 +72,11 @@ angular.module('navigation').factory('userPageService', ['$injector', | ||||
|  | ||||
|         // 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) | ||||
|         // a Settings page and is always visible, and the Session management | ||||
|         // page is also available to all users so that they can kill their | ||||
|         // own session.  We look for more than those two pages to determine | ||||
|         // if we should go to the home page. | ||||
|         if (settingsPages.length > 2) | ||||
|             return SYSTEM_HOME_PAGE; | ||||
|  | ||||
|         // Determine whether a connection or balancing group should serve as | ||||
| @@ -265,25 +267,8 @@ angular.module('navigation').factory('userPageService', ['$injector', | ||||
|                 canViewConnectionRecords.push(dataSource); | ||||
|             } | ||||
|  | ||||
|             // Determine whether the current user needs access to view session management | ||||
|             if ( | ||||
|                     // Permission to manage active sessions. | ||||
|                        PermissionSet.hasSystemPermission(permissions,           PermissionSet.SystemPermissionType.ADMINISTER) | ||||
|                     || PermissionSet.hasActiveConnectionPermission(permissions, PermissionSet.ObjectPermissionType.DELETE) | ||||
|             ) { | ||||
|                 canManageSessions.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({ | ||||
| @@ -320,6 +305,12 @@ angular.module('navigation').factory('userPageService', ['$injector', | ||||
|             url  : '/settings/preferences' | ||||
|         })); | ||||
|  | ||||
|         // Add link to Session management (always accessible) | ||||
|         pages.push(new PageDefinition({ | ||||
|             name : 'USER_MENU.ACTION_MANAGE_SESSIONS', | ||||
|             url  : '/settings/sessions' | ||||
|         })); | ||||
|  | ||||
|         return pages; | ||||
|     }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user