Skip to content

Commit aaa23a5

Browse files
committed
initial commit
1 parent 6b67f2b commit aaa23a5

26 files changed

+5348
-2
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,7 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
.zenstack
133+
.prisma
134+
*.db

README.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
# authz-modeling-samples
2-
Samples schemas for different patterns of modeling authorization
1+
# Samples ZenStack schemas for different patterns of modeling authorization
2+
3+
## What's ZenStack
4+
5+
ZenStack is a NodeJS full-stack toolkit which supercharges [Prisma ORM](https://prisma.io) in many ways. Please [read here](https://zenstack.dev/docs) first.
6+
7+
## About This Repo
8+
9+
This repo contains ZModel schemas and test code that demonstrate different patterns of modeling application's authorization.
10+
11+
You can find more detailed explanation in the blog post [Modeling Authorization in Prisma - No Theory, Just Code](https://zenstack.dev/blog/model-authz).
12+
13+
## How To Run
14+
15+
Make sure ["pnpm" is installed](https://pnpm.io/installation).
16+
17+
- pnpm install
18+
- cd samples/[sample folder]
19+
- pnpm generate
20+
- pnpm test

jest.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
transform: { '^.+\\.tsx?$': 'ts-jest' },
3+
};

package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"devDependencies": {
3+
"@types/jest": "^29.5.11",
4+
"@types/node": "^20.11.0",
5+
"ts-node": "^10.9.2",
6+
"typescript": "^5.3.3",
7+
"zenstack": "^1.6.2"
8+
},
9+
"dependencies": {
10+
"jest": "^29.7.0",
11+
"ts-jest": "^29.1.1",
12+
"tsx": "^4.7.0"
13+
}
14+
}

0 commit comments

Comments
 (0)