type

FieldAccessContext

type FieldAccessContext struct { // Context is the request-scoped cancellation and deadline context. Context context.Context // Operation is the create, read, update, or delete being evaluated. Operation Operation // CollectionID is the stable identity of the containing collection. CollectionID schema.StableID // GlobalID is the stable identity of the containing global, when applicable. GlobalID schema.StableID // ID is the current document ID. It is empty during creation. ID string // Path is the authored path of the field being evaluated. Path string // RuntimePath identifies the concrete value occurrence, including array or // block indexes. It equals Path for non-repeating fields. RuntimePath string // Actor is the authenticated document, or nil for an anonymous request. Actor *store.Document // ActorCollection identifies the exact auth collection that owns Actor. ActorCollection schema.CollectionSlug // Data contains incoming values for a write operation. Data store.Values // Value is the submitted value for a write or stored value for a read. Value store.Value // SiblingData contains the nearest containing object's values. Mutating this // detached snapshot does not mutate the operation input. SiblingData store.Values // Document is the existing or result document when available. Document *store.Document // Original is the persisted document before an update when available. Original *store.Document // Local exposes nested operations through the same transaction and access // pipeline. Rules must avoid recursively invoking themselves without a guard. Local *LocalAPI // Locale is the selected content locale. It is empty only when localization is disabled. Locale schema.LocaleCode // AllLocales reports that locale-keyed values were requested. AllLocales bool }

The concrete field occurrence and transaction state supplied to a field rule.

Source core/access.go:13

Contextcontext.Context
Request cancellation and deadline context.
OperationOperation
Create, read, update, or delete.
CollectionIDschema.StableID
Stable identity of the containing collection.
GlobalIDschema.StableID
Stable identity of the containing global, when applicable.
IDstring
Current document ID; empty during create.
Pathstring
Authored field path.
RuntimePathstring
Concrete occurrence including array or block indexes.
Actor*store.Document
Authenticated actor, or nil.
ActorCollectionschema.CollectionSlug
The exact auth collection that owns Actor.
Datastore.Values
Incoming write values.
Valuestore.Value
Submitted or stored field value.
SiblingDatastore.Values
Detached nearest-object values.
Document*store.Document
Current document when available.
Original*store.Document
Document before update.
Local*LocalAPI
Nested transaction-scoped operations.
Localeschema.LocaleCode
Selected locale.
AllLocalesbool
Whether every locale is selected.