mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-220: Remove effectively-redundant admin permission check.
This commit is contained in:
@@ -187,20 +187,16 @@ public abstract class ModeledObjectPermissionService
|
|||||||
if (identifiers.isEmpty())
|
if (identifiers.isEmpty())
|
||||||
return identifiers;
|
return identifiers;
|
||||||
|
|
||||||
// Retrieve permissions only if allowed
|
// If user is an admin, everything is accessible
|
||||||
if (canReadPermissions(user, targetEntity)) {
|
if (user.getUser().isAdministrator())
|
||||||
|
return identifiers;
|
||||||
|
|
||||||
// If user is an admin, everything is accessible
|
// Otherwise, return explicitly-retrievable identifiers only if allowed
|
||||||
if (user.getUser().isAdministrator())
|
if (canReadPermissions(user, targetEntity))
|
||||||
return identifiers;
|
|
||||||
|
|
||||||
// Otherwise, return explicitly-retrievable identifiers
|
|
||||||
return getPermissionMapper().selectAccessibleIdentifiers(
|
return getPermissionMapper().selectAccessibleIdentifiers(
|
||||||
targetEntity.getModel(), permissions, identifiers,
|
targetEntity.getModel(), permissions, identifiers,
|
||||||
effectiveGroups);
|
effectiveGroups);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// User cannot read this entity's permissions
|
// User cannot read this entity's permissions
|
||||||
throw new GuacamoleSecurityException("Permission denied.");
|
throw new GuacamoleSecurityException("Permission denied.");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user