-- Allow authenticated users (homeowners, board members) to read status updates for their associations
CREATE POLICY "Authenticated users can read status updates for their associations"
ON public.status_updates
FOR SELECT
TO authenticated
USING (
  association_id IN (SELECT public.get_user_association_ids())
  OR public.has_role(auth.uid(), 'admin'::public.app_role)
  OR public.has_role(auth.uid(), 'manager'::public.app_role)
  OR public.has_role(auth.uid(), 'employee'::public.app_role)
);