modcomms/backend/app/api
michael ebfcd60c71 Fix campaign visibility bug for unassigned users after agency reassignment
Unassigned (no agency) non-admin users previously saw ALL campaigns due to
a truthiness check that treated None agency_id as "no filter". This was a
security bug — they should see NO campaigns and be blocked from creating them.

Backend: Add _NO_AGENCY sentinel to distinguish "no filter" from "no agency",
add early-returns at all 5 list/analytics endpoints, fix _check_campaign_access
to explicitly reject unassigned users, and block campaign creation with 403.

Frontend: Add isUnassigned boolean to UserContext, show informational empty
state on Campaigns view, and reinforce readOnly for defense-in-depth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 07:42:42 -06:00
..
__init__.py Add Knowledge Base management system for AI agent specs 2026-02-12 15:00:36 -06:00
knowledge_base_routes.py Fix processing job not visible to background task (FK violation) 2026-02-12 16:09:50 -06:00
knowledge_base_schemas.py Add Knowledge Base management system for AI agent specs 2026-02-12 15:00:36 -06:00
routes.py Fix campaign visibility bug for unassigned users after agency reassignment 2026-02-22 07:42:42 -06:00
schemas.py Add 4-tier RBAC backend: auth dependencies, role enforcement, agency filtering 2026-02-19 08:28:23 -06:00