mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +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.
|
* The ID of the connection group to retrieve.
|
||||||
*
|
*
|
||||||
* @param permissions
|
* @param permissions
|
||||||
* If specified, limit the returned list to only those connections for
|
* If specified and non-empty, limit the returned list to only those
|
||||||
* which the current user has any of the given permissions. Otherwise,
|
* connections for which the current user has any of the given
|
||||||
* all visible connections are returned. Connection groups are
|
* permissions. Otherwise, all visible connections are returned.
|
||||||
* unaffected by this parameter.
|
* Connection groups are unaffected by this parameter.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* The requested connection group, including all descendants.
|
* The requested connection group, including all descendants.
|
||||||
@@ -319,6 +319,10 @@ public class ConnectionGroupRESTService {
|
|||||||
|
|
||||||
UserContext userContext = authenticationService.getUserContext(authToken);
|
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
|
// Retrieve requested connection group and all descendants
|
||||||
APIConnectionGroup connectionGroup = retrieveConnectionGroup(userContext, connectionGroupID, true, permissions);
|
APIConnectionGroup connectionGroup = retrieveConnectionGroup(userContext, connectionGroupID, true, permissions);
|
||||||
if (connectionGroup == null)
|
if (connectionGroup == null)
|
||||||
|
@@ -176,6 +176,10 @@ public class UserRESTService {
|
|||||||
UserContext userContext = authenticationService.getUserContext(authToken);
|
UserContext userContext = authenticationService.getUserContext(authToken);
|
||||||
User self = userContext.self();
|
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
|
// An admin user has access to any user
|
||||||
boolean isAdmin = self.hasPermission(new SystemPermission(SystemPermission.Type.ADMINISTER));
|
boolean isAdmin = self.hasPermission(new SystemPermission(SystemPermission.Type.ADMINISTER));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user