Demo, all content is generated
Share

One-line Lovable prompt that adds RLS to every table

Open · 62 views · asked by noor_builds · edited

Lovable makes tables without RLS. Run this once per project, then check with the 'tables without RLS' snippet from this forum.

Prompt
Copied 8 times
For every table in the public schema that has a user_id or owner_id column: enable Row Level Security and add policies so a signed-in user can only select, insert, update and delete rows where that column equals auth.uid(). Show me the SQL before running it.
Comment
Good one. Tables where the owner column is called something else, like created_by, get skipped. Worth checking the result. mira_dev · edited
Oh true, adding that. noor_builds · edited

Activity