debian-mirror-gitlab/app/policies/suggestion_policy.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
316 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
class SuggestionPolicy < BasePolicy
2022-06-21 17:19:12 +05:30
delegate { @subject.source_project }
2019-02-15 15:39:39 +05:30
condition(:can_push_to_branch) do
2022-06-21 17:19:12 +05:30
Gitlab::UserAccess.new(@user, container: @subject.source_project).can_push_to_branch?(@subject.branch)
2019-02-15 15:39:39 +05:30
end
rule { can_push_to_branch }.enable :apply_suggestion
end