2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class SuggestionPolicy < BasePolicy
|
|
|
|
delegate { @subject.project }
|
|
|
|
|
|
|
|
condition(:can_push_to_branch) do
|
2020-10-24 23:57:45 +05:30
|
|
|
Gitlab::UserAccess.new(@user, container: @subject.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
|