Filter admin project list for editors, auto-grant on create #80

Merged
qwc merged 1 commit from fix/editor-project-list-filtering into feature/pdf-upload-support 2026-02-20 07:23:44 +01:00
Owner

Summary

  • Admin project list filtering: Editors now only see projects they have access to (public, private with global grant, custom with explicit access) instead of all projects. Admins still see everything.
  • Auto-grant on create: When an editor creates a non-public project, they are automatically granted editor-level access so they retain visibility and upload rights.
  • Refactor: Extracted filterAccessibleProjects helper used by both the admin page and frontpage, eliminating duplicated filtering logic.

Fixes #77

Test plan

  • Editor creates a custom-visibility project — verify they are auto-granted editor access and can still see it
  • Editor visits /admin/projects — verify they only see projects they have access to
  • Admin visits /admin/projects — verify they still see all projects
  • go test ./... passes (2 new tests added)

🤖 Generated with Claude Code

## Summary - **Admin project list filtering**: Editors now only see projects they have access to (public, private with global grant, custom with explicit access) instead of all projects. Admins still see everything. - **Auto-grant on create**: When an editor creates a non-public project, they are automatically granted editor-level access so they retain visibility and upload rights. - **Refactor**: Extracted `filterAccessibleProjects` helper used by both the admin page and frontpage, eliminating duplicated filtering logic. Fixes #77 ## Test plan - [ ] Editor creates a custom-visibility project — verify they are auto-granted editor access and can still see it - [ ] Editor visits `/admin/projects` — verify they only see projects they have access to - [ ] Admin visits `/admin/projects` — verify they still see all projects - [ ] `go test ./...` passes (2 new tests added) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Editors previously saw all projects in the admin panel regardless of
visibility. Now non-admin users only see projects they actually have
access to (public, private with global grant, or custom with explicit
access), using the same filtering logic as the frontpage.

When an editor creates a non-public project, they are automatically
granted editor-level access so they don't lose visibility of their
own project.

Fixes #77

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
qwc merged commit c518d24113 into feature/pdf-upload-support 2026-02-20 07:23:44 +01:00
qwc deleted branch fix/editor-project-list-filtering 2026-02-20 07:23:44 +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!80
No description provided.