diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-03 15:08:46 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-06 10:42:21 +0300 |
commit | a57ec31e4575d5633341143c7b3a4f0a4350c1ec (patch) | |
tree | 5874d93b90059c886389b219ec1f210b7bb96b2a /app/policies/group_policy.rb | |
parent | 83f79ced3fd98031194e5667c4d80f66d7987c67 (diff) |
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/policies/group_policy.rb')
-rw-r--r-- | app/policies/group_policy.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index 520710b757d..ded9fe30eff 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -72,6 +72,19 @@ class GroupPolicy < BasePolicy enable :change_visibility_level end + rule { can?(:read_nested_project_resources) }.policy do + enable :read_group_activity + enable :read_group_issues + enable :read_group_boards + enable :read_group_labels + enable :read_group_milestones + enable :read_group_merge_requests + end + + rule { can?(:read_cross_project) & can?(:read_group) }.policy do + enable :read_nested_project_resources + end + rule { owner & nested_groups_supported }.enable :create_subgroup rule { public_group | logged_in_viewable }.enable :view_globally |