mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 22:21:22 +00:00
GUAC-1193: Implement front end for connection history.
This commit is contained in:
@@ -173,6 +173,7 @@ angular.module('navigation').factory('userPageService', ['$injector',
|
||||
|
||||
var canManageUsers = [];
|
||||
var canManageConnections = [];
|
||||
var canViewConnectionRecords = [];
|
||||
var canManageSessions = [];
|
||||
|
||||
// Inspect the contents of each provided permission set
|
||||
@@ -234,12 +235,13 @@ angular.module('navigation').factory('userPageService', ['$injector',
|
||||
)
|
||||
canManageConnections.push(dataSource);
|
||||
|
||||
// Determine whether the current user needs access to the session management UI
|
||||
// Determine whether the current user needs access to the session management UI or view connection history
|
||||
if (
|
||||
// A user must be a system administrator to manage sessions
|
||||
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
|
||||
)
|
||||
canManageSessions.push(dataSource);
|
||||
canViewConnectionRecords.push(dataSource);
|
||||
|
||||
});
|
||||
|
||||
@@ -250,7 +252,18 @@ angular.module('navigation').factory('userPageService', ['$injector',
|
||||
url : '/settings/sessions'
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
// If user can manage connections, add links for connection management pages
|
||||
angular.forEach(canViewConnectionRecords, function addConnectionHistoryLink(dataSource) {
|
||||
pages.push(new PageDefinition({
|
||||
name : [
|
||||
'USER_MENU.ACTION_VIEW_HISTORY',
|
||||
translationStringService.canonicalize('DATA_SOURCE_' + dataSource) + '.NAME'
|
||||
],
|
||||
url : '/settings/' + encodeURIComponent(dataSource) + '/history'
|
||||
}));
|
||||
});
|
||||
|
||||
// If user can manage users, add link to user management page
|
||||
if (canManageUsers.length) {
|
||||
pages.push(new PageDefinition({
|
||||
|
Reference in New Issue
Block a user