Skip to content

[prisma] Using extensions to remove the need for subject helper with prisma #783

@Faithfinder

Description

@Faithfinder

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions