mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 01:40:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
10 lines
286 B
SQL
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)
|
|
); |