Edit of links and database versioning

This commit is contained in:
Olaf
2026-08-24 19:39:21 +02:00
parent ff249ec911
commit 28a01175f7
12 changed files with 239 additions and 8 deletions
+30
View File
@@ -241,3 +241,33 @@ git commit the whole lot
### Assistant outcome
Ran the strict backend suite with 10 passing tests, staged all project changes, expanded `.gitignore` to exclude runtime avatar uploads, confirmed `.env`, caches, virtualenv files, bytecode, databases, and generated assets were not staged, and created the complete-project commit.
### User
version the sql schema and make sure it can be upgraded in the future.
### Assistant outcome
Replaced the unversioned schema bootstrap with ordered SQLite migrations using `PRAGMA user_version`. The current schema is migration 1, migrations are applied in order and are idempotent, and a database migration test verifies version tracking and table preservation. README migration guidance was added. The strict backend suite passed with 11 tests.
### User
allow editing of individual links - add a edit button for the links owned by the authenticated user - otherwise do not show a link
### Assistant outcome
Added owner-checked `PUT /api/links/{link_id}` updates and `can_edit` feed metadata based on the authenticated bearer token. The feed shows an inline Edit action only for the current user's links; anonymous viewers and other users receive no edit action. Added owner/permission regression coverage, bumped the feed asset to `v5`, and the strict backend suite passed with 12 tests.
### User
Add authenticated link editing
### Assistant outcome
Verified and strengthened the existing authenticated link-editing flow. Anonymous updates return `401`, owners can edit their links, non-owners receive `404`, and the browser only renders the Edit action when feed metadata has `can_edit: true`. Full strict backend validation passed with 12 tests.
### User
Expose ownership if feed data
### Assistant outcome
Added explicit `is_owner` metadata to each public feed item based on the authenticated bearer token. Anonymous and non-owner responses return `false`; the owner receives `true`. The feed Edit control now uses this field, and the strict backend suite passed with 12 tests.
### User
Render edit action for owned links
### Assistant outcome
Verified that the feed renders the Edit button only when `is_owner` is true, while the backend owner check remains enforced by `PUT /api/links/{link_id}`. The live Docker-served feed asset contains the owner-gated action, focused tests passed, and the full strict suite passed with 12 tests.
+5
View File
@@ -43,6 +43,11 @@
39. For the user filter create a dropdown of all users that are available on the server
40. If I select a user filter I want the appropriate page to be opened (e.g. /user/ for user of / -home- for all-users)
41. git commit the whole lot
42. version the sql schema and make sure it can be upgraded in the future.
43. allow editing of individual links - add a edit button for the links owned by the authenticated user - otherwise do not show a link
44. Add authenticated link editing
45. Expose ownership if feed data
46. Render edit action for owned links
## Future entries