-
-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
Description
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
teamMemberships TeamMembership[]
@@allow('all', true)
}
model TeamMembership {
id Int @id @default(autoincrement())
teamId Int
user User @relation(fields: [userId], references: [id])
userId Int
@@allow('all', true)
}
model Post {
id Int @id @default(autoincrement())
title String
owner User? @relation(fields: [ownerId], references: [id])
ownerId Int?
teamId Int
@@allow('all', true)
@@deny('all', teamId in auth().teamMemberships)
}
Inside the @@deny
rule, the "in" expression should result in a type-checker error.