summaryrefslogtreecommitdiff
path: root/app/policies/suggestion_policy.rb
blob: 301b7d965f5604ff630ba856493bb768bc18b990 (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, project: @subject.project).can_push_to_branch?(@subject.branch)
  end

  rule { can_push_to_branch }.enable :apply_suggestion
end