Initial commit: WaMarket MVP
Marketplace inversée (Next.js 16 App Router + Supabase Cloud) : auth, schéma + RLS, publication de besoins avec upload d'images, feed avec filtres, offres, acceptation via RPC, messagerie temps réel, dashboards, et Dockerfile pour déploiement Coolify.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
-- Faille corrigée : la policy offers_update_own_pending ne limitait pas la
|
||||
-- valeur cible de `status`, permettant à un marchand de passer directement sa
|
||||
-- propre offre à 'accepted' via un simple PATCH, en contournant accept_offer().
|
||||
-- Désormais, un marchand ne peut que rester en 'pending' (édition) ou passer
|
||||
-- en 'withdrawn' (retrait volontaire) ; 'accepted'/'rejected' restent
|
||||
-- exclusivement gérés par la fonction security definer accept_offer().
|
||||
|
||||
drop policy if exists "offers_update_own_pending" on public.offers;
|
||||
create policy "offers_update_own_pending"
|
||||
on public.offers for update
|
||||
to authenticated
|
||||
using ((select auth.uid()) = merchant_id and status = 'pending')
|
||||
with check ((select auth.uid()) = merchant_id and status in ('pending', 'withdrawn'));
|
||||
Reference in New Issue
Block a user