Allow editors to create new projects #66

Merged
qwc merged 1 commit from feature/editor-create-projects into main 2026-02-16 16:25:20 +01:00
Owner

Summary

  • Adds requireEditorOrAdmin middleware that allows both editor and admin roles
  • Project list (GET /admin/projects) and create (POST /admin/projects) routes now use the new middleware
  • Admin-only features (edit, delete, reindex, deploy docs, admin nav) are hidden for editors via IsAdmin template flag
  • Editors see a "Manage Projects" link in the navbar (admins still see "Admin")

Closes #63

Test plan

  • go test ./internal/handler/... — all existing tests pass
  • New tests: editor can access project management page, editor can create project, viewer still gets 403
  • Manual: log in as editor, verify "Manage Projects" link appears in navbar
  • Manual: editor can see the create form and project list, but not edit/delete/reindex buttons
  • Manual: viewer still cannot access /admin/projects

🤖 Generated with Claude Code

## Summary - Adds `requireEditorOrAdmin` middleware that allows both editor and admin roles - Project list (`GET /admin/projects`) and create (`POST /admin/projects`) routes now use the new middleware - Admin-only features (edit, delete, reindex, deploy docs, admin nav) are hidden for editors via `IsAdmin` template flag - Editors see a "Manage Projects" link in the navbar (admins still see "Admin") Closes #63 ## Test plan - [x] `go test ./internal/handler/...` — all existing tests pass - [x] New tests: editor can access project management page, editor can create project, viewer still gets 403 - [ ] Manual: log in as editor, verify "Manage Projects" link appears in navbar - [ ] Manual: editor can see the create form and project list, but not edit/delete/reindex buttons - [ ] Manual: viewer still cannot access `/admin/projects` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Allow editors to create new projects
All checks were successful
CI / test (pull_request) Successful in 1m2s
CI / build (pull_request) Successful in 49s
CI / docker (pull_request) Has been skipped
b491c0f824
Adds requireEditorOrAdmin middleware and applies it to the project list
and create routes. The admin projects page conditionally hides admin-only
features (edit, delete, reindex, deploy, admin nav) for editor users.
Editors see a "Manage Projects" link in the navbar.

Closes #63

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
qwc merged commit 208be6e3b2 into main 2026-02-16 16:25:20 +01:00
qwc deleted branch feature/editor-create-projects 2026-02-16 16:25:20 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qwc-open/asiakirjat!66
No description provided.