Skip to content

Settings Scope Precedence ​

Settings in the SDK are scoped: the same setting key can carry a different value at each scope level, and the runtime resolves them in a fixed precedence order.

A setting's detail with its existing scope overrides, and the form for adding one at tenant scope.
One setting, its overrides per scope, and the form that adds another. The lock marks a scope this actor may not write.

The five scopes ​

The ladder is Core's Scope enum (LaravelUi5\Core\Parameters\Enums\Scope), from least to most specific:

ScopeMeaning
PlatformThe default declared in code, seeded by ui5:sync (least specific)
InstallationShared override, written by an operator admin
TenantShared override, written by a tenant admin or above
SiteShared override, written by a local admin or above
UserPersonal override for one partner (most specific)

Each shared scope holds at most one value per setting. The rows carry no tenant or site id: one installation is one tenant (Tenancy). Who may write which scope is on Reading & Writing.

Resolution order ​

Platform < Installation < Tenant < Site < User

When the runtime asks "what is the value of approval.threshold for this artifact?", the highest scope present wins. A User value wins over a Site value, a Site value over a Tenant value, and so on down to the Platform default.

User is the only personal scope. A read sees every shared row (Platform to Site) plus the current actor's own User rows, never another partner's.

This means:

  • Defaults live at Platform. Declare a setting with Core's #[Setting] attribute; ui5:sync writes the declaration, its default included. It belongs to code: the settings writer refuses Scope::Platform, so a default changes only when its declaration changes.
  • Values live above it. Writing at Installation, Tenant, Site or User is gated by the setting's edit level and by which scopes the actor's system level may write.
  • Resetting a value deletes it, and the value falls back to the next scope present.

Storage ​

Settings live in two tables: the declaration, which code owns, and the values, which people own.

sdk_settings holds one declaration per artifact and key, written only by ui5:sync:

ColumnMeaning
artifact_idthe artifact the setting belongs to (FK → sdk_artifacts.id)
settingthe key (the semantic name)
default_valuethe JSON-encoded default — the Platform level
value_typeCore ValueType; see Type Validation
levelCore EditLevel, the minimum level allowed to set a value
value_help, value_help_scopethe value-help picker bound to a Model-typed setting
model_classthe Eloquent model class of a Model-typed setting

sdk_setting_values holds one value per setting, scope and (for User scope) partner, written only through the Settings app:

ColumnMeaning
setting_idthe declaration it overrides (FK → sdk_settings.id, restrict)
scopetinyint holding the Scope value — Installation or above, never Platform
partner_idthe owning partner (FK → sdk_partners.id, restrict); set only for User scope
set_bythe partner who last wrote the value
valuethe JSON-encoded value

Every change of a value lands in the change log. A declaration with values cannot be deleted, and a partner is archived, never deleted.

changed in 2.0Before 2.0 one table held both: the `Platform` row was the declaration, every other row a value that copied the declaration's type, level and value help.

Reading a setting ​

Your code reads a setting with SdkContext::setting() and gets the value that wins for the acting partner. Which artifact's settings a request sees is on Reading & Writing.

See also ​