feat(po): submitter view-all of POs + History + export (feature-flagged) #63

Merged
shad0w merged 3 commits from feat/submitter-view-all into master 2026-06-23 16:22:33 +00:00
Owner

Submitter view-all (feature-flagged)

Lets submitters (TECHNICAL / MANNING) view the History page and other users' POs, with the export buttons � gated behind a new feature flag, off by default.

Flag

NEXT_PUBLIC_SUBMITTER_VIEW_ALL_ENABLED � opt-in, on only when exactly "true". When off, behaviour is unchanged (submitters see only their own POs).

When on, submitters gain read-only access to:

  • the History page (/history) + its CSV/PDF report export
  • any other user's PO detail page (/po/[id])
  • the per-PO Export PDF / XLSX buttons (same approved/cancelled status gate as everyone else)

No approval, payment, edit, cancel, or admin rights are added; non-submitter roles are unaffected.

Implementation

  • lib/feature-flags.tsSUBMITTER_VIEW_ALL_ENABLED
  • lib/permissions.tsisSubmitterRole / submitterCanViewAll / canViewAllPos (the latter replaces two hardcoded role lists)
  • po/[id] page + per-PO export route � gate via canViewAllPos
  • History page + reports/export route � OR submitterCanViewAll into the export_reports gate
  • sidebar.tsx � show History to submitters when the flag is on

Tests

tests/unit/permissions.test.ts � helpers in both flag states (off: submitters denied, view_all_pos holders allowed; on: submitters allowed, non-submitters unchanged, still no approve/view_all_pos permission).

Verified live (flag on, TECHNICAL session)

/history ? 200, foreign PO detail ? 200, foreign PO export ? 200, report export ? 200; sidebar shows History; foreign PO renders Export PDF/XLSX. Temp DB/env mutations reverted.

Docs

.env.example + CLAUDE.md; wiki updated separately (Roles-and-Permissions, Environment-Variables, Pages-and-Navigation, Feature-Catalogue).

?? Generated with Claude Code

## Submitter view-all (feature-flagged) Lets submitters (TECHNICAL / MANNING) **view the History page and other users' POs, with the export buttons** � gated behind a new feature flag, **off by default**. ### Flag `NEXT_PUBLIC_SUBMITTER_VIEW_ALL_ENABLED` � opt-in, on only when exactly `"true"`. When **off**, behaviour is unchanged (submitters see only their own POs). When **on**, submitters gain **read-only** access to: - the **History** page (`/history`) + its CSV/PDF report export - any other user's **PO detail** page (`/po/[id]`) - the per-PO **Export PDF / XLSX** buttons (same approved/cancelled status gate as everyone else) No approval, payment, edit, cancel, or admin rights are added; non-submitter roles are unaffected. ### Implementation - `lib/feature-flags.ts` � `SUBMITTER_VIEW_ALL_ENABLED` - `lib/permissions.ts` � `isSubmitterRole` / `submitterCanViewAll` / `canViewAllPos` (the latter replaces two hardcoded role lists) - `po/[id]` page + per-PO export route � gate via `canViewAllPos` - History page + `reports/export` route � OR `submitterCanViewAll` into the `export_reports` gate - `sidebar.tsx` � show History to submitters when the flag is on ### Tests `tests/unit/permissions.test.ts` � helpers in **both** flag states (off: submitters denied, view_all_pos holders allowed; on: submitters allowed, non-submitters unchanged, still no approve/view_all_pos permission). ### Verified live (flag on, TECHNICAL session) `/history` ? 200, foreign PO detail ? 200, foreign PO export ? 200, report export ? 200; sidebar shows **History**; foreign PO renders **Export PDF/XLSX**. Temp DB/env mutations reverted. ### Docs `.env.example` + `CLAUDE.md`; wiki updated separately (Roles-and-Permissions, Environment-Variables, Pages-and-Navigation, Feature-Catalogue). ?? Generated with [Claude Code](https://claude.com/claude-code)
shad0w added 1 commit 2026-06-21 23:28:12 +00:00
feat(po): submitter view-all of POs + History + export (feature-flagged)
All checks were successful
PR checks / checks (pull_request) Successful in 34s
PR checks / integration (pull_request) Successful in 26s
da2d856b73
Gated behind NEXT_PUBLIC_SUBMITTER_VIEW_ALL_ENABLED (opt-in, "true").
When on, submitter roles (TECHNICAL/MANNING) get read-only access to every
PO: the History page + report export, any other user's PO detail page, and
the per-PO Export PDF/XLSX buttons. No approval/payment/edit rights are added.

- lib/feature-flags.ts: SUBMITTER_VIEW_ALL_ENABLED flag
- lib/permissions.ts: isSubmitterRole / submitterCanViewAll / canViewAllPos
- po/[id] page + export route: gate via canViewAllPos
- history page + reports/export route: OR submitterCanViewAll into export_reports
- sidebar: show History to submitters when flag on
- tests: permission helpers, both flag states
- docs: .env.example, CLAUDE.md (wiki updated separately)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
shad0w added 1 commit 2026-06-21 23:30:46 +00:00
Merge branch 'master' into feat/submitter-view-all
All checks were successful
PR checks / checks (pull_request) Successful in 34s
PR checks / integration (pull_request) Successful in 26s
2fd3709b22
shad0w added 1 commit 2026-06-23 16:20:10 +00:00
Merge remote-tracking branch 'origin/master' into feat/submitter-view-all
All checks were successful
PR checks / checks (pull_request) Successful in 43s
PR checks / integration (pull_request) Successful in 30s
6da6c277ad
# Conflicts:
#	App/CLAUDE.md
#	App/components/layout/sidebar.tsx
#	App/lib/feature-flags.ts
shad0w merged commit db4c2096ec into master 2026-06-23 16:22:33 +00:00
Sign in to join this conversation.
No description provided.