AccessContext
AccessContext =
object
Defined in: packages/schema/src/access/types.ts:16
What an access rule is given: who asks, for which operation, and where.
Indexable
Section titled “Indexable”[
key:string]:unknown
Properties
Section titled “Properties”holds?
Section titled “holds?”
optionalholds?: (capability) =>boolean
Defined in: packages/schema/src/access/types.ts:35
Set by the resolver for field rules: whether the caller holds a capability on every row and field, such as
workflow_runs.read, for a field that shows what another resource holds. A wildcard over resources such as *.read
does not count; without roles, it is what an operation without a rule gets.
Parameters
Section titled “Parameters”capability
Section titled “capability”string
Returns
Section titled “Returns”boolean
model?
Section titled “model?”
optionalmodel?:ResourceModel
Defined in: packages/schema/src/access/types.ts:37
Set by the resolver; scoped capabilities (.own) need model.owner.
operation?
Section titled “operation?”
optionaloperation?:AccessAction
Defined in: packages/schema/src/access/types.ts:20
The operation being decided.
organization?
Section titled “organization?”
optionalorganization?:object
Defined in: packages/schema/src/access/types.ts:24
With organizations, the one the request works in; .tenant resources are scoped to it already.
id:
string|number
The organization’s id.
optionalrole?:"owner"|"admin"|"member"
The caller’s organization role there, read from the auth store for this request; absent for someone who is no member.
record?
Section titled “record?”
optionalrecord?:unknown
Defined in: packages/schema/src/access/types.ts:22
The record the operation is on, when there is one.
optionaluser?:AccessUser
Defined in: packages/schema/src/access/types.ts:18
Always set by the server; optional in the type so rules stay callable with a bare context.