summaryrefslogtreecommitdiff
path: root/app/helpers/groups_helper.rb
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-07-03 14:08:46 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-07-06 09:42:21 +0200
commita57ec31e4575d5633341143c7b3a4f0a4350c1ec (patch)
tree5874d93b90059c886389b219ec1f210b7bb96b2a /app/helpers/groups_helper.rb
parent83f79ced3fd98031194e5667c4d80f66d7987c67 (diff)
downloadgitlab-ce-a57ec31e4575d5633341143c7b3a4f0a4350c1ec.tar.gz
Create cross project group features
This allows us to check specific abilities in views, while still enabling/disabling them at once.
Diffstat (limited to 'app/helpers/groups_helper.rb')
-rw-r--r--app/helpers/groups_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index 95fea2f18d1..3c5c8bbd71b 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -128,8 +128,10 @@ module GroupsHelper
def get_group_sidebar_links
links = [:overview, :group_members]
- if can?(current_user, :read_cross_project)
- links += [:activity, :issues, :boards, :labels, :milestones, :merge_requests]
+ resources = [:activity, :issues, :boards, :labels, :milestones,
+ :merge_requests]
+ links += resources.select do |resource|
+ can?(current_user, "read_group_#{resource}".to_sym, @group)
end
if can?(current_user, :admin_group, @group)