Module: CascadingNamespaceSettingAttribute

Extended by:
ActiveSupport::Concern
Includes:
Gitlab::Utils::StrongMemoize
Included in:
Namespace::PackageSetting, NamespaceSetting
Defined in:
app/models/concerns/cascading_namespace_setting_attribute.rb

Overview

Cascading attributes enables managing settings in a flexible way.

  • Instance administrator can define an instance-wide default setting, or lock the setting to prevent change by group owners.

  • Group maintainers/owners can define a default setting for their group, or lock the setting to prevent change by sub-group maintainers/owners.

Behavior:

  • When a group does not have a value (value is ‘nil`), cascade up the hierarchy to find the first non-nil value.

  • Settings can be locked at any level to prevent groups/sub-groups from overriding.

  • If the setting isn’t locked, the default can be overridden.

  • An instance administrator or group maintainer/owner can push settings values to groups/sub-groups to override existing values, even when the setting is not otherwise locked.