mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +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())
|
||||
return identifiers;
|
||||
|
||||
// Retrieve permissions only if allowed
|
||||
if (canReadPermissions(user, targetEntity)) {
|
||||
|
||||
// If user is an admin, everything is accessible
|
||||
if (user.getUser().isAdministrator())
|
||||
return identifiers;
|
||||
|
||||
// Otherwise, return explicitly-retrievable identifiers
|
||||
// Otherwise, return explicitly-retrievable identifiers only if allowed
|
||||
if (canReadPermissions(user, targetEntity))
|
||||
return getPermissionMapper().selectAccessibleIdentifiers(
|
||||
targetEntity.getModel(), permissions, identifiers,
|
||||
effectiveGroups);
|
||||
|
||||
}
|
||||
|
||||
// User cannot read this entity's permissions
|
||||
throw new GuacamoleSecurityException("Permission denied.");
|
||||
|
||||
|
Reference in New Issue
Block a user