zynactradocs

Manifest reference

Every field of zaccess.yaml, product and resource manifests, and org rule files.

Editors validate these files with the JSON schemas in spec/: add # yaml-language-server: $schema=<url> at the top. zaccess check is the source of truth and enforces more than the schemas can.

zaccess.yaml

spec/zaccess.schema.json.

FieldRequired
productyesPath to the product manifest. Exactly one.
resourcesPaths or globs of resource manifests.
orgRulesPaths or globs of org rule files. A glob may match nothing.
testsDirectory of Cerbos policy test suites. zaccess gen scaffolds one per new kind.
out.policiesyesDirectory Cerbos serves: resource policies, _schemas/, orgs/.
out.manifestyesThe compiled access.manifest.json, read by both SDKs.
out.tsA TypeScript module with P constants and the compiled manifest.
out.go.file, out.go.packageA Go file with permission constants and the embedded Manifest.

Paths are relative to zaccess.yaml.

Product manifest

spec/manifest.schema.json. One per product.

Field
productThe product's name: ^[a-z][a-z0-9_-]*$.
scopeTypes.<name>A product scope type (see below). global and self are built in.
systemRoles.<key>A role seeded into every org (see below). Keys are unique; access_admin is built in and can't be declared.

Scope types

FieldKinds
kindallprefix or set.
resourceAttrallThe resource attribute it reads. Every kind using the scope must declare it.
principalAttrprefixThe principal attribute the resolver supplies (reportingPath). Paths start and end with /.
excludeSelfprefixLeave the user's own records out. Needs ownerId on the kind.
expandsetExpand assigned IDs to everything below them with the resolver's ExpandSet.

System roles

Field
nameShown to admins. Required.
descriptionSay which scope to assign it with.
breakGlasstrue: assigning it needs a reason and an end at most 24 hours away; it can't be mapped to groups.
permissions.<key>A mode: inherit (the assignment's scope), self or global. The mode must be one of the scopes the action allows. "*": global means every permission that may be granted globally.

Resource manifest

One per area of the product.

Field
sourceShown in the permission catalog (leave-demo/leave).
resources.<kind>A resource kind: ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$, unique across manifests, never access.*.
resources.<kind>.attributes.<name>An attribute (see below). orgId is added automatically; don't declare it.
resources.<kind>.actions.<action>An action (see below). The permission key is <kind>:<action>; actions may contain colons.

Attributes

Either a type name, or an object:

attributes:
  ownerId: string                     # string | number | boolean
  status: { enum: [pending, approved] }
  note: { type: string, optional: true }
Field
typestring, number or boolean.
enumAllowed values; strings only.
optionalMay be absent. Required attributes must be on every check.

Actions

FieldRequired
descriptionyesWhat admins read in the role editor.
scopesyesThe scopes it may be granted at: global, self and product scope types. self needs ownerId.
conditionA CEL expression over R.attr.<declared>, P.id, P.attr.orgId and scope principal attributes. Never P.attr.perms. Needs a policy test.
sensitiveGranting it globally needs a reason and is logged with high severity.

Org rule file

spec/org-rules.schema.json. One per org.

org: org_acme
rules:
  executive_salaries:
    description: Salaries in the executive unit are visible only to the person themselves.
    deny: [employee:read:salary]
    when: R.attr.orgUnitId == "exec" && R.attr.ownerId != P.id
Field
orgThe org ID, as on the subject: letters, digits, _ and -.
rules.<name>.descriptionShown in Explain and decision logs.
rules.<name>.denyProduct permissions this rule denies. Never access.*.
rules.<name>.whenWhen it denies: the same variables as action conditions, required attributes only.

Built-in manifest

zynactra/access adds the access.* kinds (access.role, access.assignment, access.group_mapping, access.change_log, access.decision, access.delegation) and the access_admin role. See Roles and assignments.

Edit on GitHub

On this page