Changelog - 2026-11-06
An access scope the resolver built wrong is treated as unresolved
Security Behavior ChangeIn one line. access.resolve returns a where, ScopeFilters.UNRESTRICTED or nothing. Anything else, such as false, 0, '', [], {} or { merchantId: undefined }, used to open reads and some writes; it is now an unresolved scope.
What changed
- One reading of the resolver. The read path and the write guard read the result the same way. A usable scope is a non-empty object whose values are all defined (and whose
and/orbranches are too; anandwith no branch restricts nothing, so it is not usable, while an emptyormatches nothing and stays).ScopeFilters.UNRESTRICTEDandnull/undefinedkeep their meaning. - Unresolved follows
onMissing. With the default (deny) the call matches no row and a create is refused. A model that declaredonMissing: allowkeeps allowing it. - The common case.
resolve: () => ({ merchantId: user.merchantId })for a user without amerchantIdis{ merchantId: undefined }: it no longer reads as "no scope".
Who is affected
- Models whose resolver can return one of those values for some callers. Those callers now get no rows. Return
ScopeFilters.UNRESTRICTEDfor a caller that must see everything. - Everyone else. No action needed.
Details
| File | Package |
|---|---|
src/relational/core/repositories/common/scope-filter.ts | connectors |
src/relational/core/repositories/common/scope-write-guard.ts | connectors |
src/relational/core/repositories/dialect/filter.ts | connectors |