From 7e31403dfa4d6bc55f22b796cae9d76f4254e9b6 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 12 Apr 2022 09:10:41 -0100 Subject: [PATCH] confirm user is internal to globalscale Signed-off-by: Maxence Lange --- .../Collaboration/Collaborators/LookupPlugin.php | 1 + .../Collaboration/Collaborators/LookupPluginTest.php | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php index 079fd4d257527..72cbfd4de4b88 100644 --- a/lib/private/Collaboration/Collaborators/LookupPlugin.php +++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php @@ -110,6 +110,7 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) { 'label' => $label, 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => $isGlobalScaleEnabled, 'shareWith' => $lookup['federationId'], ], 'extra' => $lookup, diff --git a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php index 3ec9e6f5efcbf..1d856252745ac 100644 --- a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php @@ -303,6 +303,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[0], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => true, 'shareWith' => $fedIDs[0] ], 'extra' => ['federationId' => $fedIDs[0]], @@ -311,6 +312,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[1], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => true, 'shareWith' => $fedIDs[1] ], 'extra' => ['federationId' => $fedIDs[1]], @@ -319,6 +321,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[2], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => true, 'shareWith' => $fedIDs[2] ], 'extra' => ['federationId' => $fedIDs[2]], @@ -342,6 +345,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[0], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => true, 'shareWith' => $fedIDs[0] ], 'extra' => ['federationId' => $fedIDs[0]], @@ -350,6 +354,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[1], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => true, 'shareWith' => $fedIDs[1] ], 'extra' => ['federationId' => $fedIDs[1]], @@ -358,6 +363,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[2], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => true, 'shareWith' => $fedIDs[2] ], 'extra' => ['federationId' => $fedIDs[2]], @@ -381,6 +387,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[0], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => false, 'shareWith' => $fedIDs[0] ], 'extra' => ['federationId' => $fedIDs[0]], @@ -389,6 +396,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[1], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => false, 'shareWith' => $fedIDs[1] ], 'extra' => ['federationId' => $fedIDs[1]], @@ -397,6 +405,7 @@ public function dataSearchEnableDisableLookupServer() { 'label' => $fedIDs[2], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => false, 'shareWith' => $fedIDs[2] ], 'extra' => ['federationId' => $fedIDs[2]], @@ -471,6 +480,7 @@ public function searchDataProvider() { 'label' => $fedIDs[0], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => false, 'shareWith' => $fedIDs[0] ], 'extra' => ['federationId' => $fedIDs[0]], @@ -479,6 +489,7 @@ public function searchDataProvider() { 'label' => $fedIDs[1], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => false, 'shareWith' => $fedIDs[1] ], 'extra' => ['federationId' => $fedIDs[1]], @@ -487,6 +498,7 @@ public function searchDataProvider() { 'label' => $fedIDs[2], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, + 'globalScale' => false, 'shareWith' => $fedIDs[2] ], 'extra' => ['federationId' => $fedIDs[2]],