Changelog - 2026-10-26
A shared row can no longer be changed or deleted without sharedRows
Security Behavior ChangeIn one line. With a scope such as { or: [{ merchantId: { in: ids } }, { merchantId: null }] } and write.sharedRows: false, a restricted caller could still updateById or deleteById a shared row (merchantId is null) as long as the patch did not name merchantId. 0.4.2 has this gap; this entry closes it.
What changed
- A write selects only rows it may write. For
updateById,updateAll,updateBy,deleteById,deleteAll,deleteBy, soft delete and restore, thenullbranch of the scope is removed unlesswrite.sharedRowsistrue. A shared row does not match: the count is0and the row is unchanged. The caller's own rows work as before. - Reads are unchanged. They still return the caller's rows and the shared rows.
sharedRows: truekeeps today's behavior, andScopeFilters.UNRESTRICTEDstill bypasses the scope.- A scope the guard cannot read is refused for a delete too. An
orover several columns, a range or a nested path cannot be narrowed, sodeleteByIdand friends throwcore.repository.scope_write_denied("cannot be verified"), as an update already did. Before, a delete under such a scope ran.
Who is affected
Every app with a scope that has a null branch and sharedRows: false (the default): a shared row could be changed or deleted by any caller who could read it. Upgrade. If you relied on a merchant changing platform rows, set write.sharedRows: true on that model deliberately; it also lets any merchant create platform-wide rows, so leave it false for platform-defined data and use ScopeFilters.UNRESTRICTED for the staff who manage it. A delete under an unreadable scope shape now fails: rewrite the scope to the shapes the model settings guide lists.