canAccessLivePreview
canAccessLivePreview(
props):boolean
Defined in: packages/core/src/livePreview/canAccessLivePreview.ts:23
Answers whether a caller may enter preview mode on the public site at all: the coarse gate the Draft Mode hand-off route applies before enabling Draft Mode.
true when the caller could preview at least one collection or global that has live preview
configured: readDrafts on a resource with drafts, read on one without. Evaluated with
scope: "any", since no single document is in play. A preview URL does not reliably name the
resource it shows (a page can render several), so this is deliberately not per-resource; the
draft content itself stays behind each query’s own permission check.
Parameters
Section titled “Parameters”config
Section titled “config”Pick<VexClientConfig, "access" | "collections" | "globals" | "admin">
The resolved config (client or server); only access, collections,
globals and admin.livePreview are read.
organization?
Section titled “organization?”Record<string, unknown>
The caller’s active organization, forwarded to permission callbacks.
Record<string, unknown> | null
The authenticated caller, or null.
Returns
Section titled “Returns”boolean
Whether the caller may enter preview mode. Always true when access is not
configured, and always false when nothing has live preview configured.