From 6051426a5c11a8a08678bc77b4a04a7fd8722fb3 Mon Sep 17 00:00:00 2001 From: Arthur de Moulins Date: Wed, 27 Sep 2023 18:50:12 +0200 Subject: [PATCH] fix test --- databox/api/src/Elasticsearch/AbstractSearch.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/databox/api/src/Elasticsearch/AbstractSearch.php b/databox/api/src/Elasticsearch/AbstractSearch.php index a489c5250..e1c186550 100644 --- a/databox/api/src/Elasticsearch/AbstractSearch.php +++ b/databox/api/src/Elasticsearch/AbstractSearch.php @@ -28,13 +28,6 @@ protected function createACLBoolQuery(?string $userId, array $groupIds): ?Query\ $publicWorkspaceIds = $this->getPublicWorkspaceIds(); if (null !== $userId) { - $allowedWorkspaceIds = $this->getAllowedWorkspaceIds($userId, $groupIds); - - $aclBoolQuery->addMust(new Query\Terms( - 'workspaceId', - array_values(array_unique(array_merge($allowedWorkspaceIds, $publicWorkspaceIds))) - )); - if (!empty($publicWorkspaceIds)) { $publicWorkspaceBoolQuery = new Query\BoolQuery(); $publicWorkspaceBoolQuery->addMust(new Query\Range('privacy', [ @@ -44,6 +37,7 @@ protected function createACLBoolQuery(?string $userId, array $groupIds): ?Query\ $shoulds[] = $publicWorkspaceBoolQuery; } + $allowedWorkspaceIds = $this->getAllowedWorkspaceIds($userId, $groupIds); if (!empty($allowedWorkspaceIds)) { $workspaceBoolQuery = new Query\BoolQuery(); @@ -61,8 +55,6 @@ protected function createACLBoolQuery(?string $userId, array $groupIds): ?Query\ $shoulds[] = new Query\Terms('groups', $groupIds); } } else { - $aclBoolQuery->addMust(new Query\Terms('workspaceId', $publicWorkspaceIds)); - if (!empty($publicWorkspaceIds)) { $publicWorkspaceBoolQuery = new Query\BoolQuery(); $publicWorkspaceBoolQuery->addMust(new Query\Range('privacy', [