Section 4 of 8 · Permission Matrix
Section 04

Role-Based Permission Matrix

All permissions are enforced server-side via the user_roles table and the has_role() security-definer function. RLS policies on every table check role membership before granting read or write access.

FFull (CRUD + admin)AApprove / verifyWRead + create/edit ownRRead onlyNo access
ModuleAdminGov OfficerVetFarmerBuyerRider
Users & RolesFR
Farm VerificationFARR
Own Farm — Animals / CropsRRRF
Marketplace ListingsFRWR
Buyer Requests / OrdersFRWFR
DeliveriesFRRRW
Health Cases / VetRRFW
Outbreak ReportsFFWR
Finance — OwnRFFF
Finance — AllR
Premium AI (gated)FF
National AnalyticsFFR
Demo Mode / ResetF
Security note: Roles are stored in public.user_roles (separate from profiles) to prevent privilege escalation. The has_role() function is SECURITY DEFINER with a fixed search_path, and all RLS policies use it instead of querying roles directly — eliminating recursive RLS bugs.