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

32 lines
712 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2016-06-02 11:05:42 +05:30
module Groups
class BaseService < ::BaseService
attr_accessor :group, :current_user, :params
def initialize(group, user, params = {})
2021-04-29 21:17:54 +05:30
@group = group
@current_user = user
@params = params.dup
2016-06-02 11:05:42 +05:30
end
2019-07-07 11:18:12 +05:30
private
2021-04-29 21:17:54 +05:30
def handle_namespace_settings
settings_params = params.slice(*::NamespaceSetting::NAMESPACE_SETTINGS_PARAMS)
return if settings_params.empty?
::NamespaceSetting::NAMESPACE_SETTINGS_PARAMS.each do |nsp|
params.delete(nsp)
end
::NamespaceSettings::UpdateService.new(current_user, group, settings_params).execute
end
2019-07-07 11:18:12 +05:30
def remove_unallowed_params
# overridden in EE
end
2016-06-02 11:05:42 +05:30
end
end