mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 10:19:43 +00:00
10 lines
352 B
SQL
10 lines
352 B
SQL
-- Allow users to view their partner's responses in addition to their own
|
|
DROP POLICY IF EXISTS "Users can view own responses" ON public.responses;
|
|
|
|
CREATE POLICY "Users can view couple responses"
|
|
ON public.responses FOR SELECT
|
|
USING (
|
|
user_id = auth.uid() OR
|
|
couple_id IN (SELECT couple_id FROM public.profiles WHERE id = auth.uid())
|
|
);
|