Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
Is your feature request related to a problem? Please describe.
I love abstract models!! I tend to overuse them to track the origin of write operations. I would like to automatically retrieve the currentUser at the createdBy field level in particular.
Describe the solution you'd like
abstract model Base {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletedAt DateTime?
createdBy String @default(auth().id) <---- here
updatedBy String?
deletedBy String?
}
Describe alternatives you've considered
To keep it simple, I have to pass the currentUser.id in my forms.
Is your feature request related to a problem? Please describe. I love abstract models!! I tend to overuse them to track the origin of write operations. I would like to automatically retrieve the currentUser at the createdBy field level in particular.
Describe the solution you'd like
Describe alternatives you've considered To keep it simple, I have to pass the currentUser.id in my forms.