mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-360: Allow all users access to the session management page.
This commit is contained in:
committed by
Nick Couchman
parent
984ab48ce8
commit
3eda313519
@@ -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',
|
||||
|
Reference in New Issue
Block a user