Hi UI Bakery team,
I’m building applications in UI Bakery connected to a Supabase database, and I want to make sure I properly secure data access for different users (for example, freelancers who should only see their own data).
From the UI Bakery documentation, I see an example ( Implementing row-level security | UI Bakery Docs ) where row-level access is implemented by filtering queries using {{ user.email }}, like this:
SELECT p.*
FROM products p
JOIN user_categories uc ON p.category_id = uc.category_id
WHERE uc.user_email = {{ user.email }}
I understand that {{ user.email }} cannot be changed from the client side, which sounds safe.
However, I’m unsure how this compares to database-level security.
My main questions are:
-
Does this kind of filtering in UI Bakery fully prevent users from accessing other rows, or does it only control what the UI shows?
-
Since UI Bakery connects to the database with its own credentials, could users still see more data (for example via network inspection) if a query is not properly restricted?
-
Does it make sense (and is it supported) to use Supabase Row Level Security (RLS) together with UI Bakery?
-
If Supabase RLS is enabled, will UI Bakery continue to work normally, or do queries need to be adapted?
-
What is the recommended best-practice setup to ensure users can never access data they are not supposed to see?
For context: I’m still a beginner when it comes to database security and RLS, and I’m trying to understand the correct and safe architecture rather than relying on assumptions.
Thanks in advance for any clarification!