Prisma, Authorization, Typescript, Web Development.
create an enhanced PrismaClient for each user const emilyDb = enhance(prisma, { user: emily }); const adamDb = enhance(prisma, { user: adam }); // ❌ Adam shouldn't be able to create a resource await expect( adamDb.resource.create({ data: { name: 'resource1' } }) ).rejects.toThrow(); // Emily should