diff options
Diffstat (limited to 'app/policies/issue_policy.rb')
-rw-r--r-- | app/policies/issue_policy.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb index 538959c92bd..6114785a851 100644 --- a/app/policies/issue_policy.rb +++ b/app/policies/issue_policy.rb @@ -29,6 +29,12 @@ class IssuePolicy < IssuablePolicy @subject.work_item_type.widgets.include?(::WorkItems::Widgets::Notes) end + condition(:group_issue, scope: :subject) { subject_container.is_a?(Group) } + + rule { group_issue & can?(:read_group) }.policy do + enable :create_note + end + rule { ~notes_widget_enabled }.policy do prevent :create_note prevent :read_note |