Description
Product create/update/delete is currently allowed for any authenticated user. Restrict writes to admin emails (matching NEXT_PUBLIC_ADMIN_EMAILS) while keeping public read access.
Acceptance Criteria
Technical Notes
- See
supabase/schema.sql and lib/products.js
- Admin check today lives in
lib/AuthContext.js via NEXT_PUBLIC_ADMIN_EMAILS
- Prefer a server-side/RLS source of truth over client-only checks
Labels
enhancement, help wanted
Description
Product create/update/delete is currently allowed for any authenticated user. Restrict writes to admin emails (matching
NEXT_PUBLIC_ADMIN_EMAILS) while keeping public read access.Acceptance Criteria
supabase/schema.sqlRLS policies so only admins can insert/update/deleteproductsselectproductsproductsbucketprofilestable)Technical Notes
supabase/schema.sqlandlib/products.jslib/AuthContext.jsviaNEXT_PUBLIC_ADMIN_EMAILSLabels
enhancement,help wanted