fix: hide guests group from principal backend

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2025-05-16 18:02:23 +02:00 committed by backportbot[bot]
parent 4d63308cbf
commit 7a226807ab

View file

@ -66,8 +66,10 @@ class GroupPrincipalBackend implements BackendInterface {
$principals = [];
if ($prefixPath === self::PRINCIPAL_PREFIX) {
foreach ($this->groupManager->search('') as $user) {
$principals[] = $this->groupToPrincipal($user);
foreach ($this->groupManager->search('') as $group) {
if (!$group->hideFromCollaboration()) {
$principals[] = $this->groupToPrincipal($group);
}
}
}
@ -93,7 +95,7 @@ class GroupPrincipalBackend implements BackendInterface {
$name = urldecode($elements[2]);
$group = $this->groupManager->get($name);
if (!is_null($group)) {
if ($group !== null && !$group->hideFromCollaboration()) {
return $this->groupToPrincipal($group);
}