diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 06:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 06:09:05 +0300 |
commit | 07d0374b204881f2bd64ed897e4bbab19f180cc9 (patch) | |
tree | ed7837a31c0edae5e8ec876626b0bf3ecb3db68c /app/policies/note_policy.rb | |
parent | 2ed3b0abccc8de391f1a9de2bc5785d3e0f5b018 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies/note_policy.rb')
-rw-r--r-- | app/policies/note_policy.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/policies/note_policy.rb b/app/policies/note_policy.rb index dcde8cefa0d..54dc70b08cb 100644 --- a/app/policies/note_policy.rb +++ b/app/policies/note_policy.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class NotePolicy < BasePolicy - delegate { @subject.project } + delegate { @subject.resource_parent } delegate { @subject.noteable if DeclarativePolicy.has_policy?(@subject.noteable) } condition(:is_author) { @user && @subject.author == @user } @@ -11,7 +11,7 @@ class NotePolicy < BasePolicy condition(:can_read_noteable) { can?(:"read_#{@subject.noteable_ability_name}") } - condition(:is_visible) { @subject.visible_for?(@user) } + condition(:is_visible) { @subject.system_note_with_references_visible_for?(@user) } rule { ~editable }.prevent :admin_note |