diff options
author | Roger Rüttimann <roger.ruettimann@gmail.com> | 2018-05-01 12:24:21 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-01 12:24:21 +0300 |
commit | bc7877e8c15d9fb07824e00eeac20bb9c0f12997 (patch) | |
tree | 882e18f550a512911e045fa1ebd37738b7555481 /app | |
parent | 36043ab9f1ebe4f32e0d3192b74c902aec4f266a (diff) |
show only groups an admin is a member of in dashboards/grops
Diffstat (limited to 'app')
-rw-r--r-- | app/finders/groups_finder.rb | 8 |
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 |