Skip to content

SlotAccessContext

Defined in: packages/core/src/components/types.ts:124

Context passed to a contribution’s access predicate — a thin RBAC checker bound to the current user by the renderer (@vexcms/react’s useVexPermissions, S5), so core’s own types stay framework- and auth-adapter-agnostic. resource/action mirror hasPermission’s own vocabulary (access/hasPermission.ts) without importing its generated-type machinery here.

hasPermission: (resource, action) => boolean

Defined in: packages/core/src/components/types.ts:126

true when the current user may perform action on resource (collection/global slug, or a customResources key).

string

string

boolean


optional resource?: EditSlotProps

Defined in: packages/core/src/components/types.ts:137

Which collection/global document this render is for — populated only for edit.* slots (edit.header.*/edit.actionsMenu, whose contributions already receive this same shape as EditSlotProps), undefined for field-level slots (beforeInput/afterInput, blocks.*.actions, array.item.actions), which have no single resource kind to report. Lets a contribution that only makes sense for one kind (e.g. a collection document’s own id, meaningless for a global singleton) declare that declaratively instead of rendering null at mount time — the latter leaves its id in the resolved list, which defeats DocumentEditActionsMenu’s “no contribution survived filtering → no empty ⋯ trigger” check.