mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUAC-1001: Treat queries with empty permission filter lists as unfiltered.
This commit is contained in:
@@ -297,10 +297,10 @@ public class ConnectionGroupRESTService {
|
||||
* The ID of the connection group to retrieve.
|
||||
*
|
||||
* @param permissions
|
||||
* If specified, limit the returned list to only those connections for
|
||||
* which the current user has any of the given permissions. Otherwise,
|
||||
* all visible connections are returned. Connection groups are
|
||||
* unaffected by this parameter.
|
||||
* If specified and non-empty, limit the returned list to only those
|
||||
* connections for which the current user has any of the given
|
||||
* permissions. Otherwise, all visible connections are returned.
|
||||
* Connection groups are unaffected by this parameter.
|
||||
*
|
||||
* @return
|
||||
* The requested connection group, including all descendants.
|
||||
@@ -319,6 +319,10 @@ public class ConnectionGroupRESTService {
|
||||
|
||||
UserContext userContext = authenticationService.getUserContext(authToken);
|
||||
|
||||
// Do not filter on permissions if no permissions are specified
|
||||
if (permissions != null && permissions.isEmpty())
|
||||
permissions = null;
|
||||
|
||||
// Retrieve requested connection group and all descendants
|
||||
APIConnectionGroup connectionGroup = retrieveConnectionGroup(userContext, connectionGroupID, true, permissions);
|
||||
if (connectionGroup == null)
|
||||
|
@@ -176,6 +176,10 @@ public class UserRESTService {
|
||||
UserContext userContext = authenticationService.getUserContext(authToken);
|
||||
User self = userContext.self();
|
||||
|
||||
// Do not filter on permissions if no permissions are specified
|
||||
if (permissions != null && permissions.isEmpty())
|
||||
permissions = null;
|
||||
|
||||
// An admin user has access to any user
|
||||
boolean isAdmin = self.hasPermission(new SystemPermission(SystemPermission.Type.ADMINISTER));
|
||||
|
||||
|
Reference in New Issue
Block a user