I'm coming over from Firebase and haven't worked with Data Models like this in a while (Or RLS at all really).
I'm trying to make a contrived example of sharing data between users to better understand how to model a real world project.
So imagine I have
Users
Users
: A, B, C. and a another table
Blogs
Blogs
User A
User A
creates
Blog X
Blog X
User A
User A
invites
User B
User B
to able to SELECT/UPDATE to
Blog X
Blog X
and invites
User C
User C
to only be able to SELECT from
Blog X
Blog X
---
Is this something that I would handle with RLS? Does anyone have any examples that could get me going in a direction? I've read through auth policies but most examples like this one seem to be somewhat static (the email
@blizzard
@blizzard
isn't something one user could assign/share to another)
I'm guessing I may need to add a new role? But I'm not sure how to do that on a many-to-many relationship. i.e. Many users will have different access to many blogs.
Also, to reiterate, Blogs is just a contrived example. Imagine this scenario with anything. Chat rooms, Trello cards, Google Docs, etc...
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.