mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
GUAC-586: List readable users if applicable to management.
This commit is contained in:
@@ -169,7 +169,7 @@ public class UserRESTService {
|
|||||||
|
|
||||||
// Filter users, if requested
|
// Filter users, if requested
|
||||||
Collection<String> userIdentifiers = userDirectory.getIdentifiers();
|
Collection<String> userIdentifiers = userDirectory.getIdentifiers();
|
||||||
if (!isAdmin && permissions != null) {
|
if (!isAdmin && permissions != null && !permissions.isEmpty()) {
|
||||||
ObjectPermissionSet userPermissions = self.getUserPermissions();
|
ObjectPermissionSet userPermissions = self.getUserPermissions();
|
||||||
userIdentifiers = userPermissions.getAccessibleObjects(permissions, userIdentifiers);
|
userIdentifiers = userPermissions.getAccessibleObjects(permissions, userIdentifiers);
|
||||||
}
|
}
|
||||||
|
@@ -204,14 +204,20 @@ angular.module('settings').directive('guacSettingsUsers', [function guacSettings
|
|||||||
if (!canManageUsers())
|
if (!canManageUsers())
|
||||||
$location.path('/');
|
$location.path('/');
|
||||||
|
|
||||||
});
|
var userPromise;
|
||||||
|
|
||||||
// Retrieve all users for whom we have UPDATE or DELETE permission
|
// If users can be created, list all readable users
|
||||||
dataSourceService.apply(userService.getUsers, dataSources, [
|
if ($scope.canCreateUsers())
|
||||||
|
userPromise = dataSourceService.apply(userService.getUsers, dataSources);
|
||||||
|
|
||||||
|
// Otherwise, list only updateable/deletable users
|
||||||
|
else
|
||||||
|
userPromise = dataSourceService.apply(userService.getUsers, dataSources, [
|
||||||
PermissionSet.ObjectPermissionType.UPDATE,
|
PermissionSet.ObjectPermissionType.UPDATE,
|
||||||
PermissionSet.ObjectPermissionType.DELETE
|
PermissionSet.ObjectPermissionType.DELETE
|
||||||
])
|
]);
|
||||||
.then(function usersReceived(userArrays) {
|
|
||||||
|
userPromise.then(function usersReceived(userArrays) {
|
||||||
|
|
||||||
var addedUsers = {};
|
var addedUsers = {};
|
||||||
$scope.manageableUsers = [];
|
$scope.manageableUsers = [];
|
||||||
@@ -236,6 +242,8 @@ angular.module('settings').directive('guacSettingsUsers', [function guacSettings
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigates to an interface for creating a new user having the
|
* Navigates to an interface for creating a new user having the
|
||||||
* username specified.
|
* username specified.
|
||||||
|
Reference in New Issue
Block a user