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>
19 lines
553 B
SQL
19 lines
553 B
SQL
CREATE POLICY "Board members can insert invoices for their associations"
|
|
ON public.invoices FOR INSERT TO authenticated
|
|
WITH CHECK (
|
|
EXISTS (
|
|
SELECT 1 FROM public.board_members bm
|
|
WHERE bm.user_id = auth.uid()
|
|
AND bm.association_id = invoices.association_id
|
|
)
|
|
);
|
|
|
|
CREATE POLICY "Board members can insert bills for their associations"
|
|
ON public.bills FOR INSERT TO authenticated
|
|
WITH CHECK (
|
|
EXISTS (
|
|
SELECT 1 FROM public.board_members bm
|
|
WHERE bm.user_id = auth.uid()
|
|
AND bm.association_id = bills.association_id
|
|
)
|
|
); |