summaryrefslogtreecommitdiff
path: root/app/policies/suggestion_policy.rb
blob: 4c84c8ba690b9a551197353150990608db89d106 (plain)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

class SuggestionPolicy < BasePolicy
  delegate { @subject.project }

  condition(:can_push_to_branch) do
    Gitlab::UserAccess.new(@user, container: @subject.project).can_push_to_branch?(@subject.branch)
  end

  rule { can_push_to_branch }.enable :apply_suggestion
end