diff --git a/docs/plans/2026-05-29-project-permission-consistency-implementation.md b/docs/plans/2026-05-29-project-permission-consistency-implementation.md new file mode 100644 index 00000000..407a55ff --- /dev/null +++ b/docs/plans/2026-05-29-project-permission-consistency-implementation.md @@ -0,0 +1,57 @@ +# Project Permission Consistency Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** Make project-level backend permissions and frontend route/menu/action visibility consistent. + +**Architecture:** Treat backend `API_ENDPOINT_PERMISSIONS` and effective `/api-permissions/me` matrix as the source of truth. Frontend route guards, menus, quick actions, page actions, and attachment controls should only project that matrix into visibility or disabled states. + +**Tech Stack:** FastAPI, SQLAlchemy, pytest, Vue 3, Pinia, Vue Router, Element Plus, Vitest. + +--- + +### Task 1: Frontend Action Visibility + +**Files:** +- Modify: `frontend/src/components/QuickActions.vue` +- Modify: `frontend/src/views/ia/SubjectManagement.vue` +- Modify: `frontend/src/utils/permission.ts` +- Test: `frontend/src/components/QuickActions.test.ts` +- Test: `frontend/src/views/ia/SubjectManagement.test.ts` +- Test: `frontend/src/utils/permission.test.ts` + +**Steps:** +1. Write failing source-level tests that prove quick actions are filtered by `getProjectRoutePermission`/`hasProjectPermission`. +2. Write failing source-level tests that prove subject create/delete actions are guarded by `subjects:create` and `subjects:delete`. +3. Add minimal permission checks in the affected components. +4. Run the targeted Vitest files and confirm they pass. + +### Task 2: Permission Contract Coverage + +**Files:** +- Modify: `frontend/src/utils/projectRoutePermissions.test.ts` +- Modify: `backend/tests/test_api_permissions.py` + +**Steps:** +1. Add tests for route landing paths and project route mappings using backend operation key names already present in the frontend contract. +2. Extend backend configuration tests so service-level checks are included where feasible, especially document and attachment permission mappings. +3. Keep tests focused on permission contract shape, not business data setup. +4. Run targeted backend pytest files. + +### Task 3: Verification + +**Files:** +- No production files unless tests identify another mismatch. + +**Steps:** +1. Run targeted frontend tests. +2. Run frontend type check if dependencies are available. +3. Run targeted backend permission tests. +4. Report exact commands and results. + +### Constraints + +- Do not create branches. +- Do not commit. +- Do not revert unrelated dirty worktree changes. +- Keep changes narrow and avoid redesigning permission management. diff --git a/docs/plans/2026-06-02-material-equipment-detail.md b/docs/plans/2026-06-02-material-equipment-detail.md new file mode 100644 index 00000000..764fb578 --- /dev/null +++ b/docs/plans/2026-06-02-material-equipment-detail.md @@ -0,0 +1,38 @@ +# Material Equipment Detail Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** Add a read-only detail page for material equipment records in the material management module. + +**Architecture:** Reuse the existing material equipment API detail endpoint and the project detail-page layout conventions. Add one route, one detail view, and one list-page navigation entry without changing create/update/delete behavior. + +**Tech Stack:** Vue 3, Vue Router, Element Plus, Vitest static source tests. + +--- + +### Task 1: Route And Navigation Tests + +**Files:** +- Modify: `frontend/src/views/detailNavigation.test.ts` +- Modify: `frontend/src/views/detailBreadcrumbContext.test.ts` +- Modify: `frontend/src/views/ia/MaterialEquipment.test.ts` + +**Steps:** +1. Add the future equipment detail view to detail-navigation expectations. +2. Add breadcrumb expectations for equipment detail page title. +3. Add a list-page expectation for detail navigation. +4. Run the focused tests and confirm they fail because the route/view/link do not exist yet. + +### Task 2: Detail Page Implementation + +**Files:** +- Create: `frontend/src/views/materials/MaterialEquipmentDetail.vue` +- Modify: `frontend/src/router/index.ts` +- Modify: `frontend/src/views/ia/MaterialEquipment.vue` + +**Steps:** +1. Build a read-only detail view using `getMaterialEquipment`. +2. Set breadcrumb context using the equipment name. +3. Register `/materials/equipment/:equipmentId`. +4. Add the list table detail link. +5. Run focused frontend tests and type/build verification where feasible.