Welcome to mirror list, hosted at ThFree Co, Russian Federation.

suggestion_policy.rb « policies « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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