Changelog - 2026-11-04
access.resolve receives the operation, so one model can read wider than it writes
New Feature Breaking ChangeIn one line. settings.access.resolve receives { operation }, so a model readable by merchantId or counterpartMerchantId can still be writable by merchantId only.
What changed
resolve({ operation }).operationisScopeOperations.READ,CREATE,UPDATEorDELETE, never a group. A read and anincluded relation passREAD. An update passesUPDATEfor the payload check and for the rows it selects. A delete, a soft delete included, passesDELETEfor both. A restore passesUPDATE.ScopeOperations. It lists the four operations and two groups,WRITEandALL.ScopeOperations.includes({ group, operation })answers whether an operation belongs to a group, andisValidchecks a value.TScopeOperationis the four concrete values, andTScopeOperationGroupis all six.- The
orover two columns is still refused on a write. Return the narrow scope for a write operation instead. The message is unchanged.
Who is affected
- A model whose
resolvetakes no parameter. No action needed. Nothing changes for it. - A model with
write.sharedRows: true. Read the last point under Breaking changes. - Code that imports
ScopeWriteOperationsorTScopeWriteOperationfrom@venizia/ignis-connectorsor@venizia/ignis-connectors/relational. ImportScopeOperationsandTScopeOperationfrom@venizia/ignis-kernelor@venizia/ignis. - A repository subclass or test probe that calls
applyScopeFilter,applyDefaultFilterorguardScopedWrite. Type itsmutationoroperationasTScopeOperation, notstring. - Code that calls
access.resolve()directly. Pass{ operation }. - A repository subclass that overrides
updateByIdorupdateAlland relies on seeing every soft delete. A soft delete (deleteById,deleteAll,deleteByon a soft-deletable repository) now calls the protected_updatedirectly, withScopeOperations.DELETE, so those overrides no longer run for it. Put the logic in_update, or override thedelete*method.
Breaking changes
WARNING
This affects code that imports the old constant or types a mutation as string.
Before:
import { ScopeWriteOperations, type TScopeWriteOperation } from '@venizia/ignis-connectors/relational';
scoped(opts: { where: TWhere; mutation?: string }) {
return this.applyScopeFilter({ userFilter: { where: opts.where }, mutation: opts.mutation });
}After:
import { ScopeOperations, type TScopeOperation } from '@venizia/ignis';
scoped(opts: { where: TWhere; mutation?: TScopeOperation }) {
return this.applyScopeFilter({ userFilter: { where: opts.where }, mutation: opts.mutation });
}ScopeWriteOperations.CREATE and UPDATE are now ScopeOperations.CREATE and UPDATE. ScopeWriteOperations.SCHEME_SET held two values. ScopeOperations.SCHEME_SET holds six, and ScopeOperations.OPERATION_SET holds the four concrete ones.
With write.sharedRows: true, the rows an update or delete selects are now refused when the scope is one the guard cannot read, such as a range, a like or an or over two columns. Before, that case accepted any shape. Return a scope the guard can read.
Details
Read both columns, write one:
import { ScopeOperations } from '@venizia/ignis';
const access = {
resolve: ({ operation }) => {
const merchantId = currentMerchantId();
return ScopeOperations.includes({ group: ScopeOperations.WRITE, operation })
? { merchantId }
: { or: [{ merchantId }, { counterpartMerchantId: merchantId }] };
},
};The model settings guide has the full example and the operation each repository call passes.