Skip to content

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.

[key: string]: unknown

optional model?: ResourceModel

Defined in: packages/schema/src/access/types.ts:29

Set by the resolver; scoped capabilities (.own) need model.owner.


optional operation?: AccessAction

Defined in: packages/schema/src/access/types.ts:20

The operation being decided.


optional organization?: 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.


optional record?: unknown

Defined in: packages/schema/src/access/types.ts:22

The record the operation is on, when there is one.


optional user?: 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.