Commit 85f11eff authored by Yorick Peterse's avatar Yorick Peterse

Refactor API::Settings for EE

This refactors API::Settings so that EE can more easily extend its
behaviour, without having to modify the CE source code directly.
parent 3156db32
...@@ -9,6 +9,11 @@ module API ...@@ -9,6 +9,11 @@ module API
@current_setting ||= @current_setting ||=
(ApplicationSetting.current_without_cache || ApplicationSetting.create_from_defaults) (ApplicationSetting.current_without_cache || ApplicationSetting.create_from_defaults)
end end
def filter_attributes_using_license(attrs)
# This method will be redefined in EE.
attrs
end
end end
desc 'Get the current application settings' do desc 'Get the current application settings' do
...@@ -156,6 +161,8 @@ module API ...@@ -156,6 +161,8 @@ module API
attrs[:password_authentication_enabled_for_web] = attrs.delete(:password_authentication_enabled) attrs[:password_authentication_enabled_for_web] = attrs.delete(:password_authentication_enabled)
end end
attrs = filter_attributes_using_license(attrs)
if ApplicationSettings::UpdateService.new(current_settings, current_user, attrs).execute if ApplicationSettings::UpdateService.new(current_settings, current_user, attrs).execute
present current_settings, with: Entities::ApplicationSetting present current_settings, with: Entities::ApplicationSetting
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment