GUACAMOLE-1812: Always show the UI to edit own password for administrators.

This commit is contained in:
James Muehlner
2023-06-15 22:33:40 +00:00
parent 103398c6fd
commit c433c6ccda

View File

@@ -174,10 +174,17 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
permissionService.getEffectivePermissions(dataSource, username) permissionService.getEffectivePermissions(dataSource, username)
.then(function permissionsRetrieved(permissions) { .then(function permissionsRetrieved(permissions) {
// Add action for changing password if permission is granted // Add action for updating password
$scope.canChangePassword = PermissionSet.hasUserPermission(permissions, $scope.canChangePassword = (
PermissionSet.ObjectPermissionType.UPDATE, username);
// If permission is explicitly granted
PermissionSet.hasUserPermission(permissions,
PermissionSet.ObjectPermissionType.UPDATE, username)
// Or if implicitly granted through being an administrator
|| PermissionSet.hasSystemPermission(permissions,
PermissionSet.SystemPermissionType.ADMINISTER));
}) })
['catch'](requestService.createErrorCallback(function permissionsFailed(error) { ['catch'](requestService.createErrorCallback(function permissionsFailed(error) {
$scope.canChangePassword = false; $scope.canChangePassword = false;