Skip to content

PERMISSION_SCOPES

const PERMISSION_SCOPES: object

Defined in: packages/core/src/access/constants.ts:72

How hasPermission answers a quantified question: when no data is supplied and a role’s check is a callback that needs the document, the scope decides what “yes” would even mean.

  • doc — “may they do this to THIS document?” data is required; a callback that needs it and does not get it throws VexAccessError. Opt into this in edit views and row actions, where a silent false would surface as a permanently disabled control and read like a misconfigured matrix.
  • any — “may they do this to AT LEAST ONE document?” Resolves such a callback to true without invoking it. Use for nav/sidebar/list gating; per-document filtering still happens downstream in find/get.
  • all (default) — “may they do this to EVERY document?” Resolves such a callback to false: a per-document condition cannot hold for all of them. Fail-closed, so omitting scope never throws and never over-permits.

Static boolean checks are unaffected by scope, and any scope evaluates the callback normally once data is supplied.

readonly all: "all" = "all"

readonly any: "any" = "any"

readonly doc: "doc" = "doc"