Commit f7c013d8 authored by Andrea Galbusera's avatar Andrea Galbusera

Fix cascading settings attr reader behavior

If an instance-level lock exists, it must win over any ancestor lock:
ensure locked_value() returns the application settings value if that
is the case.

Changelog: fixed
parent ed7db880
......@@ -176,10 +176,10 @@ module CascadingNamespaceSettingAttribute
private
def locked_value(attribute)
return application_setting_value(attribute) if locked_by_application_setting?(attribute)
ancestor = locked_ancestor(attribute)
return ancestor.read_attribute(attribute) if ancestor
Gitlab::CurrentSettings.public_send(attribute) # rubocop:disable GitlabSecurity/PublicSend
end
def locked_ancestor(attribute)
......
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