CREATE POLICY "Public can view associations with published page"
ON public.associations
FOR SELECT
TO anon, authenticated
USING (
  EXISTS (
    SELECT 1 FROM public.association_public_pages app
    WHERE app.association_id = associations.id
      AND app.is_published = true
  )
);