What it is
ZenStack is a toolkit that simplifies the development of a web app's backend. It supercharges Prisma ORM with a powerful access control layer and unleashes its full potential for web development.
Our goal is to let you save time writing boilerplate code and focus on building real features!
How it works
ZenStack extended Prisma schema language for supporting custom attributes and functions and, based on that, implemented a flexible access control layer around Prisma.
// schema.zmodel
model Post {
id String @id
title String
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId String
// ๐ allow logged-in users to read published posts
@@allow('read', auth() != null && published)
// ๐ allow full CRUD by author
@@allow('all', author == auth())
}
At runtimeโฆ