djbalinD
Convex Community10mo ago
11 replies
djbalin

Granular RLS (e.g. oldDoc/newDoc)

Using rowLevelSecurity from convex-helpers, is it possible to set up granular permissions based on e.g. the kind of modification being made? Similarly to how triggers have change.oldDoc and change.newDoc

For example, if you have role = "user" | "admin" on the users schema and write an RLS rule such that a user can only modify their own document - wouldn't a user be able to change their own role to admin? What's the best approach to granular RLS?
Was this page helpful?