mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-11 07:27:42 +00:00
GUACAMOLE-220: Add management tab and editor for user groups.
This commit is contained in:
@@ -192,6 +192,7 @@ angular.module('navigation').factory('userPageService', ['$injector',
|
||||
var pages = [];
|
||||
|
||||
var canManageUsers = [];
|
||||
var canManageUserGroups = [];
|
||||
var canManageConnections = [];
|
||||
var canViewConnectionRecords = [];
|
||||
var canManageSessions = [];
|
||||
@@ -235,6 +236,24 @@ angular.module('navigation').factory('userPageService', ['$injector',
|
||||
canManageUsers.push(dataSource);
|
||||
}
|
||||
|
||||
// Determine whether the current user needs access to the group management UI
|
||||
if (
|
||||
// System permissions
|
||||
PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.ADMINISTER)
|
||||
|| PermissionSet.hasSystemPermission(permissions, PermissionSet.SystemPermissionType.CREATE_USER_GROUP)
|
||||
|
||||
// Permission to update user groups
|
||||
|| PermissionSet.hasUserGroupPermission(permissions, PermissionSet.ObjectPermissionType.UPDATE)
|
||||
|
||||
// Permission to delete user groups
|
||||
|| PermissionSet.hasUserGroupPermission(permissions, PermissionSet.ObjectPermissionType.DELETE)
|
||||
|
||||
// Permission to administer user groups
|
||||
|| PermissionSet.hasUserGroupPermission(permissions, PermissionSet.ObjectPermissionType.ADMINISTER)
|
||||
) {
|
||||
canManageUserGroups.push(dataSource);
|
||||
}
|
||||
|
||||
// Determine whether the current user needs access to the connection management UI
|
||||
if (
|
||||
// System permissions
|
||||
@@ -295,6 +314,14 @@ angular.module('navigation').factory('userPageService', ['$injector',
|
||||
}));
|
||||
}
|
||||
|
||||
// If user can manage user groups, add link to group management page
|
||||
if (canManageUserGroups.length) {
|
||||
pages.push(new PageDefinition({
|
||||
name : 'USER_MENU.ACTION_MANAGE_USER_GROUPS',
|
||||
url : '/settings/userGroups'
|
||||
}));
|
||||
}
|
||||
|
||||
// If user can manage connections, add links for connection management pages
|
||||
angular.forEach(canManageConnections, function addConnectionManagementLink(dataSource) {
|
||||
pages.push(new PageDefinition({
|
||||
|
Reference in New Issue
Block a user