debian-mirror-gitlab/app/services/protected_branches/base_service.rb

29 lines
633 B
Ruby
Raw Normal View History

2021-11-11 11:23:49 +05:30
# frozen_string_literal: true
module ProtectedBranches
class BaseService < ::BaseService
2022-01-26 12:08:38 +05:30
include ProtectedRefNameSanitizer
2021-11-11 11:23:49 +05:30
# current_user - The user that performs the action
# params - A hash of parameters
def initialize(project, current_user = nil, params = {})
@project = project
@current_user = current_user
@params = params
end
def after_execute(*)
# overridden in EE::ProtectedBranches module
end
2021-12-07 22:27:20 +05:30
2022-01-26 12:08:38 +05:30
private
2021-12-07 22:27:20 +05:30
def filtered_params
return unless params
2022-01-26 12:08:38 +05:30
params[:name] = sanitize_name(params[:name]) if params[:name].present?
2021-12-07 22:27:20 +05:30
params
end
2021-11-11 11:23:49 +05:30
end
end