Skip to content

Commit

Permalink
Merge pull request #727 from nextcloud/backport/726/stable22
Browse files Browse the repository at this point in the history
[stable22] remove root circles from search for new members
  • Loading branch information
ArtificialOwl authored Jul 22, 2021
2 parents 5a780d7 + f7d3a77 commit 144622a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Collaboration/v2/CollaboratorSearchPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b
->setItemsLimit($limit)
->setItemsOffset($offset)
->setFilterCircle($filterCircle)
->mustBeMember(!$fromFrontEnd);
->mustBeMember(!$fromFrontEnd)
->filterConfig(Circle::CFG_ROOT, $fromFrontEnd);

$circles = $this->circleService->getCircles($probe);
} catch (Exception $e) {
Expand Down
16 changes: 16 additions & 0 deletions lib/Model/Probes/CircleProbe.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,22 @@ public function filterBackendCircles(bool $filter = true): self {
}


/**
* @param int $config
* @param bool $filter
*
* @return $this
*/
public function filterConfig(int $config, bool $filter = true): self {
$this->filter |= $config;
if (!$filter) {
$this->filter -= $config;
}

return $this;
}


/**
* @return int
*/
Expand Down

0 comments on commit 144622a

Please sign in to comment.