Closed jacebenson closed 2 years ago
You can add where
clauses to update, and delete calls in prisma.
This should simplify RLS for api side.
This will be handled with "before" "read" and "readAll" rules to add proper where clauses.
This is done and just needs some docs on it here: https://github.com/tskrio/docs/issues/10
I'm not sure the best way to do this, at the time of writing, this can be accomplished with before read rules. I don't like this but, it would make life pretty simple. Just modify the query appropriately for the logged in user.
If they only can see their records, when they do a search for preferences containing language, then append { userId: session.user.id } to each of their queries.
Another option would be to make another folder for these kind of rules where by role we limit what they can see.