diff --git a/lib/Db/MembersRequest.php b/lib/Db/MembersRequest.php index 729be15d0..1357e88f7 100644 --- a/lib/Db/MembersRequest.php +++ b/lib/Db/MembersRequest.php @@ -512,8 +512,8 @@ public function createMember(Member $member) { * * @return Member[] */ - public function getGroupsFromCircle($circleUniqueId, Member $viewer) { - if ($viewer->getLevel() < Member::LEVEL_MEMBER) { + public function getGroupsFromCircle($circleUniqueId, ?Member $viewer, bool $forceAll = false) { + if (!$forceAll && $viewer->getLevel() < Member::LEVEL_MEMBER) { return []; } @@ -527,7 +527,7 @@ public function getGroupsFromCircle($circleUniqueId, Member $viewer) { $cursor = $qb->execute(); $groups = []; while ($data = $cursor->fetch()) { - if ($viewer->getLevel() < Member::LEVEL_MODERATOR) { + if (!$forceAll && $viewer->getLevel() < Member::LEVEL_MODERATOR) { $data['note'] = ''; } $groups[] = $this->parseGroupsSelectSql($data); diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index b4b29601d..25ba2eb1d 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -285,7 +285,7 @@ public function detailsCircle($circleUniqueId, $forceAll = false) { ->isLevel(Member::LEVEL_MEMBER) ) { $this->detailsCircleMembers($circle, $forceAll); - $this->detailsCircleLinkedGroups($circle); + $this->detailsCircleLinkedGroups($circle, $forceAll); $this->detailsCircleFederatedCircles($circle); } } catch (Exception $e) { @@ -324,12 +324,12 @@ private function detailsCircleMembers(Circle $circle, $forceAll = false) { * * @throws GSStatusException */ - private function detailsCircleLinkedGroups(Circle $circle) { + private function detailsCircleLinkedGroups(Circle $circle, bool $forceAll = false) { $groups = []; if ($this->configService->isLinkedGroupsAllowed()) { $groups = $this->membersRequest->getGroupsFromCircle( - $circle->getUniqueId(), $circle->getHigherViewer() + $circle->getUniqueId(), $circle->getHigherViewer(), $forceAll ); }