getUser()->isAdmin()) { $forbiddenEntityTypeList = []; $scopes = $this->getMetadata()->get('scopes', []); foreach ($scopes as $scope => $item) { $entity = $item['entity'] ?? null; if (!$entity) continue; if (!$this->getAcl()->checkScope($scope)) { $forbiddenEntityTypeList[] = $scope; } } if (!empty($forbiddenEntityTypeList)) { $result['whereClause'][] = [ 'entityType!=' => $forbiddenEntityTypeList, ]; } } } }