Skip to content

Commit

Permalink
GUACAMOLE-538: Add web application support for AUDIT permission.
Browse files Browse the repository at this point in the history
  • Loading branch information
necouchman committed Jul 9, 2024
1 parent 7b628dc commit 7626a8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ angular.module('manage').directive('systemPermissionEditor', ['$injector',
label: "MANAGE_USER.FIELD_HEADER_ADMINISTER_SYSTEM",
value: PermissionSet.SystemPermissionType.ADMINISTER
},
{
label: "MANAGE_USER.FIELD_HEADER_AUDIT_SYSTEM",
value: PermissionSet.SystemPermissionType.AUDIT
},
{
label: "MANAGE_USER.FIELD_HEADER_CREATE_NEW_USERS",
value: PermissionSet.SystemPermissionType.CREATE_USER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ angular.module('navigation').factory('userPageService', ['$injector',

// Determine whether the current user needs access to view connection history
if (
// A user must be a system administrator to view connection records
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
// A user must be a system administrator or auditor to view connection records
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
|| PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.AUDIT)
) {
canViewConnectionRecords.push(dataSource);
}
Expand All @@ -312,7 +313,7 @@ angular.module('navigation').factory('userPageService', ['$injector',
url : '/settings/sessions'
}));

// If user can manage connections, add links for connection management pages
// If user can view connection records, add links for connection history pages
angular.forEach(canViewConnectionRecords, function addConnectionHistoryLink(dataSource) {
pages.push(new PageDefinition({
name : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ angular.module('rest').factory('PermissionSet', [function definePermissionSet()
* Permission to administer the entire system.
*/
ADMINISTER : "ADMINISTER",

/**
* Permission to view connection and user records for the entire system.
*/
AUDIT : "AUDIT",

/**
* Permission to create new users.
Expand Down
2 changes: 2 additions & 0 deletions guacamole/src/main/frontend/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@
"ERROR_PASSWORD_MISMATCH" : "@:APP.ERROR_PASSWORD_MISMATCH",

"FIELD_HEADER_ADMINISTER_SYSTEM" : "Administer system:",
"FIELD_HEADER_AUDIT_SYSTEM" : "Audit system:",
"FIELD_HEADER_CHANGE_OWN_PASSWORD" : "Change own password:",
"FIELD_HEADER_CREATE_NEW_USERS" : "Create new users:",
"FIELD_HEADER_CREATE_NEW_USER_GROUPS" : "Create new user groups:",
Expand Down Expand Up @@ -449,6 +450,7 @@
"DIALOG_HEADER_ERROR" : "@:APP.DIALOG_HEADER_ERROR",

"FIELD_HEADER_ADMINISTER_SYSTEM" : "@:MANAGE_USER.FIELD_HEADER_ADMINISTER_SYSTEM",
"FIELD_HEADER_AUDIT_SYSTEM" : "@:MANAGE_USER.FIELD_HEADER_AUDIT_SYSTEM",
"FIELD_HEADER_CHANGE_OWN_PASSWORD" : "@:MANAGE_USER.FIELD_HEADER_CHANGE_OWN_PASSWORD",
"FIELD_HEADER_CREATE_NEW_USERS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_USERS",
"FIELD_HEADER_CREATE_NEW_USER_GROUPS" : "@:MANAGE_USER.FIELD_HEADER_CREATE_NEW_USER_GROUPS",
Expand Down

0 comments on commit 7626a8d

Please sign in to comment.