Pathfinder Docs

Documentation Preview

Caseworker Access Fix

Source: `docs/security/CASEWORKER_ACCESS_FIX.md`View on GitHub

Caseworker Access Fix

Date: November 24, 2025
Issue: Caseworkers could not see clients they created through the intake form

Last verified against code: 2025-02-03

Problem Summary

Caseworkers saw no clients on /clients after creating households via intake because households were created without org_id, and RLS filters by org_id for caseworkers.

Root Causes

  1. Missing Organization Association — Intake submit API was not setting org_id and created_by from the authenticated user's profile.
  2. Missing Update Policy — No RLS UPDATE policy allowed caseworkers to update clients in their org.

Changes Made

  1. Intake submission route (app/api/intake/submit/route.ts) — Capture authenticated user's org_id and set org_id, created_by, and intake_method on household insert.
  2. Migration DATABASE_MIGRATION_ADD_CASEWORKER_CLIENT_UPDATE.sql — ADD policy so caseworkers can UPDATE clients in their org.

Related


Use links in each imported doc to open its source.