Skip to content

Commit 0437378

Browse files
authored
Merge pull request #53077 from nextcloud/backport/52914/stable31
[stable31] fix: hide guests group from principal backend
2 parents 6e27aa5 + 78ba825 commit 0437378

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/dav/lib/DAV/GroupPrincipalBackend.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ public function getPrincipalsByPrefix($prefixPath) {
5050
$principals = [];
5151

5252
if ($prefixPath === self::PRINCIPAL_PREFIX) {
53-
foreach ($this->groupManager->search('') as $user) {
54-
$principals[] = $this->groupToPrincipal($user);
53+
foreach ($this->groupManager->search('') as $group) {
54+
if (!$group->hideFromCollaboration()) {
55+
$principals[] = $this->groupToPrincipal($group);
56+
}
5557
}
5658
}
5759

@@ -77,7 +79,7 @@ public function getPrincipalByPath($path) {
7779
$name = urldecode($elements[2]);
7880
$group = $this->groupManager->get($name);
7981

80-
if (!is_null($group)) {
82+
if ($group !== null && !$group->hideFromCollaboration()) {
8183
return $this->groupToPrincipal($group);
8284
}
8385

0 commit comments

Comments
 (0)