diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-28 12:08:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-28 12:08:05 +0300 |
commit | 4c788f43cbcd70bcceb4e40891d329952aa016d0 (patch) | |
tree | 9cd741579d79355a207ab74d37f26af768281fa0 /app/policies/draft_note_policy.rb | |
parent | 616129d41caac06a1ea0b0a36d1b3018eabac833 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies/draft_note_policy.rb')
-rw-r--r-- | app/policies/draft_note_policy.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/policies/draft_note_policy.rb b/app/policies/draft_note_policy.rb new file mode 100644 index 00000000000..be99d12c5f8 --- /dev/null +++ b/app/policies/draft_note_policy.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class DraftNotePolicy < BasePolicy + delegate { @subject.merge_request } + + condition(:is_author) { @user && @subject.author == @user } + + rule { is_author }.policy do + enable :read_note + enable :admin_note + enable :resolve_note + end +end |