[prisma] Using extensions to remove the need for `subject` helper with prisma
Author: FaithfinderCreated Jul 4, 2023Updated Nov 14, 2023
Labelsenhancement
Is your feature request related to a problem? Please describe.
Currently, you need the subject helper to use CASL with Prisma. With client extensions being stable now, we can do better.
Describe the solution you'd like
Provide a pre-packaged extension in CASL, that will add the model name to a field in prisma client (maybe use a symbol for the field?). Make the default detectSubjectType know how to read that field.
Describe alternatives you've considered This is fairly easily solvable in user-land, just thought it might be a good idea if the prisma package made the process streamlined.
Source: stalniy/casl