summaryrefslogtreecommitdiff
path: root/app/policies/draft_note_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/draft_note_policy.rb')
-rw-r--r--app/policies/draft_note_policy.rb13
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