ZenStack is a NodeJS full-stack toolkit which supercharges Prisma ORM in many ways. Please read here first.
This repo contains ZModel schemas and test code that demonstrate different patterns of modeling application's authorization.
You can find more detailed explanation in the blog post Modeling Authorization in Prisma - No Theory, Just Code.
Make sure "pnpm" is installed.
- pnpm install
- cd samples/[sample folder]
- pnpm generate
- pnpm test
- simple-acl: simple access control list
- simple-rbac: simple role-based access control
- simple-abac: simple attribute-based access control
- multi-tenancy: SaaS-like multi-tenancy authorization
Please join ZenStack Discord to let us know your needs.