modcomms/backend/app
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
..
agents Standardise Issue/Recommendation formatting across all agents 2026-02-19 10:17:08 -06:00
api Fix campaign visibility bug for unassigned users after agency reassignment 2026-02-22 07:42:42 -06:00
dependencies Add 4-tier RBAC backend: auth dependencies, role enforcement, agency filtering 2026-02-19 08:28:23 -06:00
models Fix SpecVersion/ProcessingJob circular relationship direction error 2026-02-12 15:42:35 -06:00
repositories Add 4-tier RBAC backend: auth dependencies, role enforcement, agency filtering 2026-02-19 08:28:23 -06:00
services Standardise Issue/Recommendation formatting across all agents 2026-02-19 10:17:08 -06:00
websocket Wire up Errors tab in Auditing: auto-create ErrorItem on Analysis Error 2026-02-12 13:55:16 -06:00
__init__.py permissions changes 2025-12-18 16:51:27 +00:00
config.py Add Knowledge Base management system for AI agent specs 2026-02-12 15:00:36 -06:00
main.py Add 4-tier RBAC backend: auth dependencies, role enforcement, agency filtering 2026-02-19 08:28:23 -06:00