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
|