We are building an app for e-commerce merchants, their consumers, products, orders, and more. A highly relational structure. We opted for Supabase for Authentication and the database to service the application.
An authenticated User can take actions on products in our dashboard to create settings for campaigns. When I put together the backend query on Supabase -> Products and go to constrain that data using the filter, I am assuming I just need that the user is Authenticated and the multitenancy restricts the products the user can see.
Our hierarchy looks like this: user is FK on a store, store is an FK on a product so by filtering on the Auth User I believe we are only getting the products for the store the user is a FK on.
The Auth User is also not stored in the Supabase db we import. There is a second USER table that connects to their auth data and allows them to manage their profile and account.
I believe no filter is needed as long as the user is Authenticated, the only data they should see is where their authenticated userID is the userID on the store and or products.