summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorRoger Rüttimann <roger.ruettimann@gmail.com>2018-05-01 09:24:21 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-01 09:24:21 +0000
commitbc7877e8c15d9fb07824e00eeac20bb9c0f12997 (patch)
tree882e18f550a512911e045fa1ebd37738b7555481 /app/finders
parent36043ab9f1ebe4f32e0d3192b74c902aec4f266a (diff)
downloadgitlab-ce-bc7877e8c15d9fb07824e00eeac20bb9c0f12997.tar.gz
show only groups an admin is a member of in dashboards/grops
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/groups_finder.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/finders/groups_finder.rb b/app/finders/groups_finder.rb
index 0282b378d88..0754123a3cf 100644
--- a/app/finders/groups_finder.rb
+++ b/app/finders/groups_finder.rb
@@ -39,7 +39,7 @@ class GroupsFinder < UnionFinder
def all_groups
return [owned_groups] if params[:owned]
- return [Group.all] if current_user&.full_private_access?
+ return [Group.all] if current_user&.full_private_access? && all_available?
groups = []
groups << Gitlab::GroupHierarchy.new(groups_for_ancestors, groups_for_descendants).all_groups if current_user
@@ -67,6 +67,10 @@ class GroupsFinder < UnionFinder
end
def include_public_groups?
- current_user.nil? || params.fetch(:all_available, true)
+ current_user.nil? || all_available?
+ end
+
+ def all_available?
+ params.fetch(:all_available, true)
end
end