Closed
Description
model User {
id Int @id @default(autoincrement())
admin Boolean @default(false)
username String @unique @allow("all", auth() == this) @allow("all", auth().admin)
password String @password @default("") @allow("all", auth() == this) @allow("all", auth().admin)
firstName String @default("")
lastName String @default("")
@@allow('all', auth() == this)
@@allow('all', auth().admin)
@@allow('create', true)
}
Output:
node_modules/.zenstack/policy.ts:58:22 - error TS2304: Cannot find name 'id'.
58 return ((user == id) || (user?.admin ?? null))