Files
acmcc/supabase/migrations/20260508022917_d947fac0-5615-4cf7-ba5e-b080424bbe22.sql
T
2026-06-01 20:19:26 -04:00

10 lines
286 B
SQL

CREATE POLICY "Users can delete own messages"
ON public.direct_messages
FOR DELETE
TO authenticated
USING (
auth.uid() = sender_id
OR auth.uid() = recipient_id
OR public.has_role(auth.uid(), 'admin'::public.app_role)
OR public.has_role(auth.uid(), 'manager'::public.app_role)
);