Security Configuration Guide
Complete RLS rules for all entities in your dashboard
⚠️ CRITICAL: Apply RLS Rules Immediately
Without RLS, your data is exposed! Follow these steps carefully:
- Go to Base44 Dashboard → Security tab
- For EACH entity below, click the entity name
- Click "+ Add Rule" for each operation (Create, Read, Update, Delete)
- Copy the exact rule text from this page
- Set conditions matching the rule type:
- • "No Restrictions" = Enable Allow Access
- • "User Property Check (user.role = 'admin')" = Select User Property → role → equals → admin
- • "Entity-User Field Comparison (user_id = currentUser.id)" = Select Entity Field → user_id → equals → currentUser.id
- • For OR conditions, add multiple rules separately
- Save each entity after adding all rules
- Test with a non-admin account to verify
Implementation Checklist
Total Entities to Configure: 21
✓ Bookmark this page for reference
✓ Start with Admin-Only entities first (most critical)
✓ Test each entity after configuration
✓ Keep a backup of current settings before making changes
ServiceCategory
✅ Service categories managed by admins
User Property Check (user.role = 'admin')
No Restrictions
User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
ServiceProvider
✅ Public directory. Providers update own profiles.
No Restrictions
No Restrictions
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
SkillUpCourse
✅ Admin-managed courses
User Property Check (user.role = 'admin')
No Restrictions
User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
B2BTender
✅ Admin-managed, publicly viewable
User Property Check (user.role = 'admin')
No Restrictions
User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
ServiceRequest
⚠️ RLS disabled for payment flows
No Restrictions
No Restrictions
Entity-User Field Comparison (customer_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (customer_id = currentUser.id) OR User Property Check (user.role = 'admin')
UserSkillProfile
✅ Private skill profiles
No Restrictions
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id)
Entity-User Field Comparison (user_id = currentUser.id)
UserCourseProgress
✅ Private course progress
No Restrictions
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id)
Entity-User Field Comparison (user_id = currentUser.id)
CustomerExpense
✅ Private expense data
No Restrictions
Entity-User Field Comparison (customer_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (customer_id = currentUser.id)
Entity-User Field Comparison (customer_id = currentUser.id)
RecurringExpense
✅ Private recurring expenses
No Restrictions
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id)
Entity-User Field Comparison (user_id = currentUser.id)
BillReminder
✅ Private bill reminders
No Restrictions
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id)
Entity-User Field Comparison (user_id = currentUser.id)
FinancialGoal
✅ Private financial goals
No Restrictions
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id)
Entity-User Field Comparison (user_id = currentUser.id)
Notification
✅ Private notifications
No Restrictions
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id)
Entity-User Field Comparison (user_id = currentUser.id)
FavoriteProvider
✅ Private favorites list
No Restrictions
Entity-User Field Comparison (customer_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (customer_id = currentUser.id)
Entity-User Field Comparison (customer_id = currentUser.id)
Message
✅ Users see sent messages
No Restrictions
Entity-User Field Comparison (sender_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (sender_id = currentUser.id) OR User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
Conversation
✅ Both participants can access
No Restrictions
Entity-User Field Comparison (customer_id = currentUser.id) OR Entity-User Field Comparison (provider_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (customer_id = currentUser.id) OR Entity-User Field Comparison (provider_id = currentUser.id) OR User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
LeadPurchase
⚠️ RLS disabled for payment flows
No Restrictions
No Restrictions
Entity-User Field Comparison (provider_user_id = currentUser.id) OR User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
Booking
✅ Both parties view, provider updates
No Restrictions
Entity-User Field Comparison (customer_id = currentUser.id) OR Entity-User Field Comparison (provider_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (provider_id = currentUser.id) OR User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
Payment
✅ Users manage own payments
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
Entity-User Field Comparison (user_id = currentUser.id) OR User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
CreditTransaction
⚠️ RLS disabled for payment flows
No Restrictions
No Restrictions
No Restrictions
No Restrictions
PlatformSettings
✅ Public read, admin write
User Property Check (user.role = 'admin')
No Restrictions
User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
FeaturedListing
✅ Public read, admin manage
User Property Check (user.role = 'admin')
No Restrictions
User Property Check (user.role = 'admin')
User Property Check (user.role = 'admin')
Dashboard Rule Types:
- • No Restrictions - Anyone can access (public)
- • Creator Only - Only user who created the record (created_by field)
- • Entity-User Field Comparison - Compare entity field with current user (e.g., user_id = currentUser.id)
- • User Property Check - Check user properties (e.g., user.role = 'admin' or user.id exists)
- • Multiple rules with OR - Add multiple rules separately in dashboard, they work as OR conditions
4
Public Readable Entities
9
User-Private Entities
2
Conversational Entities
2
Provider-Specific Entities
2
Payment & Transaction Entities
2
Admin-Only Settings
