diff options
Diffstat (limited to 'app/policies/issuable_policy.rb')
-rw-r--r-- | app/policies/issuable_policy.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/policies/issuable_policy.rb b/app/policies/issuable_policy.rb index 212f4989557..f0aa16d2ecf 100644 --- a/app/policies/issuable_policy.rb +++ b/app/policies/issuable_policy.rb @@ -1,7 +1,8 @@ class IssuablePolicy < BasePolicy delegate { @subject.project } - condition(:locked) { @subject.discussion_locked? } + condition(:locked, scope: :subject, score: 0) { @subject.discussion_locked? } + condition(:is_project_member) { @user && @subject.project && @subject.project.team.member?(@user) } desc "User is the assignee or author" @@ -16,5 +17,11 @@ class IssuablePolicy < BasePolicy enable :update_merge_request end - rule { locked & ~is_project_member }.prevent :create_note + rule { locked & ~is_project_member }.policy do + prevent :create_note + prevent :update_note + prevent :admin_note + prevent :resolve_note + prevent :edit_note + end end |