fix(auth): rename seeded permission groups to Viewer and Editor

Every install showed "Viewer (legacy)" and "Editor (legacy)" as the built-in
groups, which reads as deprecated. 0092 already shipped in 5.3.0, so a new
revision renames the untouched system rows and drops the "pre-upgrade"
framing from their descriptions. It skips a group whose target name an admin
already took, and keeps a description the admin edited.

Fixes #4678

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xdb9FnfhEqP6ectkSZ2T3F
This commit is contained in:
Sam Dornan
2026-09-25 00:36:34 +00:00
committed by Claude
parent a63d67f539
commit 86fa809612
8 changed files with 151 additions and 15 deletions

View File

@@ -10,7 +10,7 @@ Two accounts, matching the two sides of every permission assertion:
* ``e2e_admin`` — role admin, so `useCan` short-circuits to true and every
gated affordance must be present.
* ``e2e_viewer`` — the seeded "Viewer (legacy)" group, i.e. library read plus
* ``e2e_viewer`` — the seeded "Viewer" group, i.e. library read plus
own collections/assets. Every ROM write affordance must be absent.
Never point this at a real library: it writes users with a known password.
@@ -32,7 +32,7 @@ from handler.auth import auth_handler # noqa: E402
from handler.database import db_permission_handler, db_user_handler # noqa: E402
from models.user import Role, User # noqa: E402
VIEWER_GROUP_NAME = "Viewer (legacy)"
VIEWER_GROUP_NAME = "Viewer"
E2E_ADMIN_USERNAME = "e2e_admin"
E2E_VIEWER_USERNAME = "e2e_viewer"