-
-
Notifications
You must be signed in to change notification settings - Fork 122
Closed
Labels
Milestone
Description
Is your feature request related to a problem? Please describe.
If i already set the UserId when creating the EnhancedPrisma
it would be nice not have to pass an additonal argument around for the user or session to ensure a field is populated with the right value.
Describe the solution you'd like
model Post {
id String @id
title String @length(1, 100)
author User @relation(fields: [authorId], references: [id])
+ authorId String @default(auth().id)
@@allow('update', author == auth() && future().author == author)
}
Additional features that would be nice might be using other fields related to the user.
model Post {
id String @id
title String @length(1, 100)
author User @relation(fields: [authorId], references: [id])
authorId String @default(auth().id)
+ tenantId String @default(auth().tenantId)
@@allow('update', author == auth() && future().author == author)
}
Azzerty23, bvkimball, eelior, jasonmacdonald, DawidWraga and 7 more