GUAC-1193: Implement front end for connection history.

This commit is contained in:
James Muehlner
2015-10-13 23:38:55 -07:00
parent 03c1ac1876
commit fdbc68bb92
11 changed files with 357 additions and 41 deletions

View File

@@ -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({