ReferenceIndividual lint rules
ZenStack access policies
Check configured ZenStack model access declarations.
Checks resolved ZModel access declarations, including delegated allow predicates. A literal broad allow can be reported even when another policy covers the same operation.
Enable this opt-in rule under lint.rules.
Configuration
import { defineConfig } from '@mwillbanks/zenstack-zenlev'
export default defineConfig({
lint: {
rules: {
'zenlev/zenstack/policies': [
'error',
{
include: ['public.Order'],
commands: ['read', 'update'],
postUpdate: true,
noBroad: true,
},
],
},
},
})Parameters
commandsacceptscreate,read,update,delete,post-update, andall. Required commands look for an applicable allow declaration.postUpdate: truerequires an explicitpost-updatepolicy. Anallpolicy does not satisfy that check.noBroad: trueflags literal true allow predicates.
All built-in rules accept the shared selectors.
Example
For this PostgreSQL example, public.Order selects the logical model in the public schema. Use @@map("orders") to set its physical table name. Give read and update applicable allow predicates, then add a separate post-update policy. Validate the predicates for the application role.