@Override
    public void deletePermissions(ModeledAuthenticatedUser user,
            ModeledPermissions<? extends EntityModel> targetEntity,
            Collection<ObjectPermission> permissions)
            throws GuacamoleException {

        // Delete permissions only if user has permission to do so
        if (canAlterPermissions(user, targetEntity, permissions)) {

            CaseSensitivity caseSensitivity = getCaseSensitivity();
            
            batchPermissionUpdates(permissions, permissionSubset -> {
                Collection<ObjectPermissionModel> models = getModelInstances(
                        targetEntity, permissionSubset);
                getPermissionMapper().delete(models, caseSensitivity);
            });

            return;
        }
        
        // User lacks permission to delete object permissions
        throw new GuacamoleSecurityException("Permission denied.");

    }
Determines whether the current user has permission to update the given
target entity, adding or removing the given permissions. Such permission
depends on whether the current user is a system administrator, whether
they have explicit UPDATE permission on the target entity, and whether
they have explicit ADMINISTER permission on all affected objects.
Permission inheritance via user groups is taken into account.

@param user
    The user who is changing permissions.

@param targetEntity
    The entity whose permissions are being changed.

@param permissions
    The permissions that are being added or removed from the target
    entity.

@return
    true if the user has permission to change the target entity's
    permissions as specified, false otherwise.

@throws GuacamoleException
    If an error occurs while checking permission status, or if
    permission is denied to read the current user's permissions.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/permission/ModeledObjectPermissionService.java