modcomms/frontend
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
..
components Fix Agency Admin campaign creation and proof upload permissions 2026-02-22 07:23:58 -06:00
contexts Fix campaign visibility bug for unassigned users after agency reassignment 2026-02-22 07:42:42 -06:00
hooks Add PDF preview support with on-demand rasterization 2026-01-25 08:56:23 -06:00
services Add frontend RBAC: UserContext, role-based sidebar, agency filter, user management 2026-02-19 08:36:38 -06:00
utils Add frontend RBAC: UserContext, role-based sidebar, agency filter, user management 2026-02-19 08:36:38 -06:00
App.tsx Fix campaign visibility bug for unassigned users after agency reassignment 2026-02-22 07:42:42 -06:00
constants.ts Restructure agent system: remove Tone, split Channel, implement Legal 2026-01-24 11:58:17 -06:00
index.html UI overhaul: white backgrounds, flat design, teal hero, sidebar flush-left nav 2026-02-05 16:53:03 -06:00
index.tsx permissions changes 2025-12-18 16:51:27 +00:00
metadata.json permissions changes 2025-12-18 16:51:27 +00:00
package-lock.json permissions changes 2025-12-18 16:51:27 +00:00
package.json permissions changes 2025-12-18 16:51:27 +00:00
README.md permissions changes 2025-12-18 16:51:27 +00:00
tsconfig.json permissions changes 2025-12-18 16:51:27 +00:00
types.ts Add frontend RBAC: UserContext, role-based sidebar, agency filter, user management 2026-02-19 08:36:38 -06:00
vite.config.ts permissions changes 2025-12-18 16:51:27 +00:00

GHBanner

Run and deploy your AI Studio app

This contains everything you need to run your app locally.

View your app in AI Studio: https://ai.studio/apps/drive/1vH-R-vj0Xkk_g2ZFdHtLxNc12sFTOl2L

Run Locally

Prerequisites: Node.js

  1. Install dependencies: npm install
  2. Set the GEMINI_API_KEY in .env.local to your Gemini API key
  3. Run the app: npm run dev