FleetOS Row Level Security (RLS) Setup
Critical Security Notice
What is Row Level Security?
How to Apply RLS Policies
Option 1: Via Supabase SQL Editor (Recommended)
Option 2: Via psql CLI
Verification
Testing RLS Policies
Test 1: Verify Users Can't See Each Other's Data
Test 2: Verify Suppliers Can Only See Assigned Requests
Test 3: Verify Magic Link Tracking Works (No Auth)
RLS Policy Summary
users table
user_profiles table
suppliers table
service_requests table
fleetos_invites table
fleetos_relationships table
viral_* tables
Important Notes
Public Access Exceptions
Admin Access
Rollback (Emergency Use Only)
Troubleshooting
"No rows returned" but I know data exists
"Permission denied for table X"
"Function auth.uid() does not exist"
Next Steps After Applying RLS
Last updated
Was this helpful?