e812922a26
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3.1 KiB
3.1 KiB
plan, phase, status, started, completed, requirements
| plan | phase | status | started | completed | requirements | ||
|---|---|---|---|---|---|---|---|
| 06.2-02 | 06.2 | complete | 2026-05-31 | 2026-05-31 |
|
Plan 06.2-02 Summary — SHARE-05 + SHARE-03 Gap Closure
What Was Built
Closed two open v1 requirements in a single vertical slice:
- SHARE-05 (badge bug): DocumentCard.vue fixed —
Sharedpill now readsdoc.is_shared(boolean from backend) instead ofdoc.share_count > 0(field that doesn't exist in API response). - SHARE-03 (no permission control): End-to-end permission flow wired from creation through editing.
Backend (Task 1)
ShareCreatemodel gainedpermission: str = "view"withfield_validatorenforcing{"view", "edit"}.SharePermissionPatchmodel added (same validator).grant_share()handler updated from hardcodedpermission="view"topermission=body.permission.- New
PATCH /api/shares/{share_id}endpoint added (placed before DELETE per route-ordering convention). IDOR protection mirrorsrevoke_shareexactly: 404 on owner mismatch to prevent enumeration. - 3 xfail stubs from Plan 06.2-01 promoted to real tests.
Frontend (Task 2)
- DocumentCard.vue: one-line fix —
v-if="doc.share_count > 0"→v-if="doc.is_shared". - ShareModal.vue: permission
<select>(Can view/Can edit) inserted between handle input and submit button; defaults to "view"; resets after successful share. - ShareModal.vue: static "view" span replaced with View/Edit toggle group per share row — optimistic update with rollback on error; in-flight state tracked via
updatingPermissionSet. - documents.js:
shareDocumentupdated to acceptpermissionparam;updateSharePermission(shareId, permission)action added. - api/client.js:
createSharepassespermissionin POST body;updateSharePermissionPATCH helper added.
Test Results
backend/tests/test_shares.py — 12 passed, 0 failed, 0 xfailed
All pre-existing share tests pass. 3 promoted stubs now pass as real integration tests.
Key Files
Created
- (no new files)
Modified
backend/api/shares.py— permission field, SharePermissionPatch model, PATCH endpointbackend/tests/test_shares.py— 3 xfail stubs promoted to real testsfrontend/src/components/documents/DocumentCard.vue— is_shared badge fixfrontend/src/components/sharing/ShareModal.vue— permission dropdown + View/Edit togglefrontend/src/stores/documents.js— shareDocument signature + updateSharePermission actionfrontend/src/api/client.js— createShare body + updateSharePermission helper
Self-Check: PASSED
- POST /api/shares with permission="edit" stores "edit" — confirmed by test_share_create_with_permission
- PATCH /api/shares/{id} changes permission — confirmed by test_share_patch_permission
- PATCH by wrong owner returns 404 — confirmed by test_share_patch_idor
- DocumentCard reads doc.is_shared (not doc.share_count)
- ShareModal has permission dropdown with "Permission level" aria-label
- ShareModal share rows have View/Edit toggle with handlePermissionChange
- 12 tests pass, 0 fail