Files
acmcc/supabase/migrations/20260423033742_09cc316d-e990-4ac7-a76d-ddb74242af93.sql
T
2026-06-01 20:19:26 -04:00

14 lines
363 B
SQL

CREATE POLICY "Homeowners can view own unit ledger entries"
ON public.owner_ledger_entries
FOR SELECT
TO authenticated
USING (
EXISTS (
SELECT 1
FROM public.owners o
WHERE o.user_id = auth.uid()
AND o.association_id = owner_ledger_entries.association_id
AND o.unit_id IS NOT NULL
AND o.unit_id = owner_ledger_entries.unit_id
)
);