From e6b26612fa97b74db3f90af55a2afac5e46ad23e Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 6 Jun 2025 11:29:16 +0200 Subject: [PATCH] fix: hide guests group when searching for principals Follow-up for https://github.com/nextcloud/server/pull/52914 Signed-off-by: Daniel Kesselberg --- apps/dav/lib/DAV/GroupPrincipalBackend.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index ce8359c13b9..93caa87e59f 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -204,6 +204,10 @@ class GroupPrincipalBackend implements BackendInterface { $groups = $this->groupManager->search($value, $searchLimit); $results[] = array_reduce($groups, function (array $carry, IGroup $group) use ($restrictGroups) { + if ($group->hideFromCollaboration()) { + return $carry; + } + $gid = $group->getGID(); // is sharing restricted to groups only? if ($restrictGroups !== false) {