Prisma, Authorization, Typescript, Web Development.
assigned to the role } model Permission { id Int @id @default(autoincrement()) name String // "view" or "manage", use an enum if database supports it roles Role[] } model Resource { id Int @id @default(autoincrement()) name String @@allow('read', auth().roles?[permissions?[name == 'view']])