docs/policies/templates/. It contains a policy.ts file with the permission definitions and a README.md with the scenario, expected decisions, and notes on engine limitations where relevant.
Seed the exported arrays into kavach_permissions (and the supporting tables noted in each README), then call engine.evaluate() against them.
Templates
How to use a template
- Copy
policy.tsfrom the template directory into your project. - Seed the exported permission arrays into
kavach_permissionsusing your database adapter. - For templates that need supporting rows (delegation chains, ReBAC tuples, rate-limit counters), follow the instructions in the template’s
README.md. - Call
engine.evaluate({ subject, action, resource })in your request handler.
packages/core/tests/policies/templates/ show exactly how each template behaves and can serve as integration tests in your own suite.