Row-Level Security Setup Guide
Follow this checklist to properly secure your multi-tenant app data
Important: Complete in Base44 Dashboard
These rules must be set up in the Base44 dashboard, not in code.
- Open your Base44 dashboard
- Navigate to "Database" or "Entities" section
- Click on each entity listed below
- Look for "Security Rules", "Access Control", or "Row-Level Security"
- Add the specified rule for each entity
What RLS Does
Row-Level Security (RLS) ensures that users can only see and interact with data that belongs to their specific tenant (restaurant).
Without RLS, invited users might see data from other restaurants, or users might accidentally create new tenants instead of joining existing ones.
The rule tenant_id == user.tenant_id means: "Only show records where the record's tenant_id matches the logged-in user's tenant_id"
RLS Rules Checklist
SOP
tenant_id == user.tenant_idSOPCollection
tenant_id == user.tenant_idSOPTemplate
tenant_id == user.tenant_idChecklist
tenant_id == user.tenant_idChecklistTemplate
tenant_id == user.tenant_idIncident
tenant_id == user.tenant_idIncidentForm
tenant_id == user.tenant_idStaff
tenant_id == user.tenant_idDepartment
tenant_id == user.tenant_idForm
tenant_id == user.tenant_idFormSubmission
tenant_id == user.tenant_idQuiz
tenant_id == user.tenant_idQuizCollection
tenant_id == user.tenant_idQuizAttempt
tenant_id == user.tenant_idStaffInvitation
tenant_id == user.tenant_idTenantSpecial Case
id == user.tenant_idUsers can only see their own tenant record
After Setup
Once all RLS rules are configured:
- Invited users will only see data for their restaurant
- Users cannot accidentally access other tenants' data
- Multi-tenant architecture will be properly secured
- Team members will appear in "Team Access" for the correct tenant