docs: reframe access control to ABAC; align Plan 2 to unified /projects/:id; add Appendix G plan-by-plan roadmap (what/why/how)
This commit is contained in:
@@ -76,19 +76,21 @@
|
||||
- [ ] **Step 2:** `npm run build` → `✓ built`.
|
||||
- [ ] **Step 3:** commit `git commit -m "fix(projects): allow admin/field-agent to open project detail, not just owner"`.
|
||||
|
||||
## Task 4: Add `/…/projects/:projectId` routes for all three role prefixes
|
||||
## Task 4: Add the unified `/projects/:projectId` route (Option B)
|
||||
|
||||
**Files:** `src/App.jsx` only. **Phase B (parallel).**
|
||||
|
||||
- [ ] **Step 1:** Add routes rendering `OwnerProjectDetail`: `/admin/projects/:projectId` (ADMIN, OWNER) and `/emp/fa/projects/:projectId` (FIELD_AGENT, ADMIN, OWNER), mirroring the existing `/owner/projects/:projectId`. (Optionally also `/admin/projects` and `/emp/fa/projects` → `OwnerProjectList`.)
|
||||
We adopt the final Option-B scheme for the projects route now — a single, role-prefix-free URL — so won leads and projects share one page. The **attribute-based access guard arrives in Phase 8**; for the interim, gate with a coarse `allowedRoles`.
|
||||
|
||||
- [ ] **Step 1:** Add a route `/projects/:projectId` → `OwnerProjectDetail`, gated `allowedRoles={['OWNER','ADMIN','FIELD_AGENT']}` (interim coarse guard — Phase 8 replaces it with the ABAC policy guard). Leave the existing `/owner/projects/:projectId` route in place for now (Phase 8 removes the duplicate). Do NOT add `/admin/projects` / `/emp/fa/projects` role-prefixed copies.
|
||||
- [ ] **Step 2:** `npm run build` → `✓ built`.
|
||||
- [ ] **Step 3:** commit `git commit -m "feat(routes): add /admin and /emp/fa projects routes for the unified detail page"`.
|
||||
- [ ] **Step 3:** commit `git commit -m "feat(routes): add unified /projects/:id route for the shared detail page"`.
|
||||
|
||||
## Task 5: Relink the kanban drawer so won leads open the project page
|
||||
|
||||
**Files:** `src/components/kanban/LeadInfoDrawer.jsx`, `src/pages/KanbanPage.jsx`. **Phase B (parallel).**
|
||||
|
||||
- [ ] **Step 1:** In `LeadInfoDrawer.jsx` (~line 302) the "More Details" button does `navigate(\`${basePath}/leads/${lead.id}\`)`. Change it so: if the lead has a `projectId` (won), navigate to `\`${basePath}/projects/${lead.projectId}\``; else keep `\`${basePath}/leads/${lead.id}\``.
|
||||
- [ ] **Step 1:** In `LeadInfoDrawer.jsx` (~line 302) the "More Details" button does `navigate(\`${basePath}/leads/${lead.id}\`)`. Change it so: if the lead has a `projectId` (won), navigate to the unified `\`/projects/${lead.projectId}\`` (no basePath); else keep `\`${basePath}/leads/${lead.id}\`` (pre-sale leads stay role-prefixed until Phase 8).
|
||||
- [ ] **Step 2:** Check `KanbanPage.jsx` for any other lead→detail navigation and apply the same conditional.
|
||||
- [ ] **Step 3:** `npm run build` → `✓ built`.
|
||||
- [ ] **Step 4:** commit `git commit -m "feat(kanban): won leads open the unified project page; pre-sale leads stay on lead page"`.
|
||||
@@ -97,7 +99,7 @@
|
||||
|
||||
**Files:** `src/pages/owner/OwnerProjectList.jsx` only. **Phase B (parallel).**
|
||||
|
||||
- [ ] **Step 1:** This page lists both construction projects (→ `/owner/projects/:id`) and pipeline leads (→ `/owner/leads/:id`, lines ~499/565). For pipeline leads that now have a `projectId` (won), link to `/owner/projects/:projectId` instead. Pre-sale leads keep `/owner/leads/:id`.
|
||||
- [ ] **Step 1:** This page lists both construction projects and pipeline leads (links ~lines 280/366 and 499/565). Point ALL project links AND won pipeline leads (those with a `projectId`) at the unified `/projects/:id`. Pre-sale leads keep `/owner/leads/:id`.
|
||||
- [ ] **Step 2:** `npm run build` → `✓ built`.
|
||||
- [ ] **Step 3:** commit `git commit -m "feat(projects): project list links won pipeline jobs to the unified project page"`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user