What are the Redwood best practices when it comes to row-level permissions?
It seems like requireAuth() RBAC is the best we’ve got, but it doesn’t cover use cases where, say, a given Author
should be able to view and edit some Post
s but not others. As another example, unauthenticated users should probably have access to Post
s where post.isPublished==true
but not where post.isPublished==false
. I can attempt to limit this on the client-side but that leaves the API layer unsecured.
I see there have been a few previous discussions on using postgres RLS, but there doesn’t seem to be a settled best practice for Redwood. Even with GraphQL Trusted Documents enabled, malicious users with access to some data could just swap out primary keys and access whatever rows they want to.
This seems like a super common type of requirement - how are people addressing their row-level authorization needs?