Skip to content

isViewOrganizationScopingEnabled

isViewOrganizationScopingEnabled(access): boolean

Defined in: packages/core/src/access/resolveViewOrganizationScope.ts:22

Whether saved (vex_views) shared views are scoped to the caller’s own organization at ALL — access?.organizations === true is the SOLE trigger (developer-approved, binding correction). orgCollectionSlug alone does NOT turn this on: it only says WHERE organization data lives, so a project’s own permission callbacks can read organization — a project that declares orgCollectionSlug for that reason alone, with no intent to scope views by it, must NOT have every shared view and “Save as shared” silently vanish for every caller the moment it sets the slug.

The ONE place this decision is made — listViews/loadSharedSavedListViewWheres/ saveView/removeView (server, @vexcms/core/server) and useCanAccessSharedSavedListViews (client, @vexcms/react) all call this directly (or through resolveViewOrganizationId), so none of them can independently drift on whether scoping is active.

VexAccessConfig<Record<string, SubjectEntry>, readonly AccessResource[], string, string | undefined, Partial<Record<string, CustomActionsInput>>> | undefined

config.access (server) or useVexAccess() (client) — undefined when RBAC isn’t configured at all.

boolean

true only when access.organizations is explicitly true.