summaryrefslogtreecommitdiff
path: root/app/policies/draft_note_policy.rb
blob: be99d12c5f8c8d56f0ba4298920a4af3476a4d95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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