diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2019-03-01 18:27:43 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-03-04 19:44:57 +0300 |
commit | 85f11eff9b588c7252ea39ad73ac9c70e0e736bb (patch) | |
tree | b4bee4ee19695d943220b44b3fc60276b18f5fda /lib/api/settings.rb | |
parent | 3156db32937940a712bab55c0b4c534f339d2652 (diff) |
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.
Diffstat (limited to 'lib/api/settings.rb')
-rw-r--r-- | lib/api/settings.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/api/settings.rb b/lib/api/settings.rb index b16faffe335..3cb2f69c4ef 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -9,6 +9,11 @@ module API @current_setting ||= (ApplicationSetting.current_without_cache || ApplicationSetting.create_from_defaults) end + + def filter_attributes_using_license(attrs) + # This method will be redefined in EE. + attrs + end end desc 'Get the current application settings' do @@ -156,6 +161,8 @@ module API attrs[:password_authentication_enabled_for_web] = attrs.delete(:password_authentication_enabled) end + attrs = filter_attributes_using_license(attrs) + if ApplicationSettings::UpdateService.new(current_settings, current_user, attrs).execute present current_settings, with: Entities::ApplicationSetting else |