debian-mirror-gitlab/app/policies/suggestion_policy.rb
2022-06-21 17:19:12 +05:30

11 lines
316 B
Ruby

# frozen_string_literal: true
class SuggestionPolicy < BasePolicy
delegate { @subject.source_project }
condition(:can_push_to_branch) do
Gitlab::UserAccess.new(@user, container: @subject.source_project).can_push_to_branch?(@subject.branch)
end
rule { can_push_to_branch }.enable :apply_suggestion
end