# ConfigResolver Service

`api/services/ConfigResolver.php` centralizes retrieval of page layouts and UI actions.
Records may exist globally, per tenant or per department. When resolving a
configuration the service searches in this order:

1. Department level – matching `tenant_id` and `department_id`.
2. Tenant level – matching `tenant_id` with a `NULL` department.
3. Super level – both identifiers `NULL`.

For `ui_actions` the resolver returns one action per `action_key` from the
highest matching level. `page_configs` returns the single row for the requested
`page`.

`PageConfigsController` and `UiActionsController` now use this service so that
department and tenant specific overrides automatically replace global defaults.
The default dataset (`sql/defaults.sql`) populates `ui_actions` for every dashboard card slug so the permissions context menu works immediately after installation.
For more on the inheritance order consult
[`HierarchicalConfiguration.md`](../HierarchicalConfiguration.md).
