Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Sep 27, 2023
1 parent d2244cf commit 6051426
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions databox/api/src/Elasticsearch/AbstractSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand All @@ -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();

Expand All @@ -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', [
Expand Down

0 comments on commit 6051426

Please sign in to comment.