feat(po): submitter view-all of POs + History + export (feature-flagged) #63
No reviewers
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
epic
feature
interactive
portal
triaged
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shad0w/pelagia-portal#63
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/submitter-view-all"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
/history) + its CSV/PDF report export/po/[id])No approval, payment, edit, cancel, or admin rights are added; non-submitter roles are unaffected.
Implementation
lib/feature-flags.ts�SUBMITTER_VIEW_ALL_ENABLEDlib/permissions.ts�isSubmitterRole/submitterCanViewAll/canViewAllPos(the latter replaces two hardcoded role lists)po/[id]page + per-PO export route � gate viacanViewAllPosreports/exportroute � ORsubmitterCanViewAllinto theexport_reportsgatesidebar.tsx� show History to submitters when the flag is onTests
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