GRI-1978: panel users, roles and permission-gated nav (campus test scope) #173

Merged
vivy merged 1 commit from feature/GRI-1978-panel-users-permissions into dev 2026-11-14 00:42:27 +00:00
Member

What

Panel screens for users, roles and permissions, scoped to the campus
production test (chief of staff's release note, 2026-11-13):

  • UsersScreen: list, create, edit and delete users for admins
    (users_manage). Role is one of the fixed set (Admin, Campus Editor) — there is no group CRUD yet, matching the server. A
    non-admin group's user is scoped to one campus or "All campuses";
    an admin group always sees every campus.
  • DashboardScreen: the Devices/IP rules/Media/Playlists/Users/
    Settings tabs and the routes behind them are gated by the signed-in
    user's permissions. IP rules needs devices_approve, Settings and
    Users need settings_manage/users_manage — a Campus Editor sees
    neither tab, and typing the URL directly shows "You do not have
    permission to view this page" instead of the screen.
  • SessionUser now carries isAdmin, campusId and permissions,
    parsed from the server's UserView (is_admin, campus_id,
    permissions — GRI-1970, already in dev).
  • New read-only campusApi and userGroupsApi modules back the
    create/edit form's campus and role selects.

API tokens are explicitly out of scope for this release (not needed
for the one-campus test); left for a follow-up.

Testing

No QA-authored frontend tests exist for this screen; this repo's
convention has the frontend engineer write vitest tests alongside
each screen (GRI-1764), with QA owning backend acceptance tests
(e.g. GRI-1971). UsersScreen.test.tsx and DashboardScreen.test.tsx
cover: loading/empty/error states, create/edit/delete, duplicate
email, an admin-group campus refusal, and the permission-gated nav
and routing.

scripts/local-gates.sh --frontend-only: prettier, oxlint
(--deny-warnings), tsc -b, the full vitest suite (48 passed) and
vite build all passed.

I could not drive the app in a real browser in this sandbox (no
Playwright/Chromium available, no network to fetch one) — the states
above are verified through jsdom-rendered component tests with real
user interaction (@testing-library/user-event), not a screenshot.

Closes #52.

## What Panel screens for users, roles and permissions, scoped to the campus production test (chief of staff's release note, 2026-11-13): - `UsersScreen`: list, create, edit and delete users for admins (`users_manage`). Role is one of the fixed set (`Admin`, `Campus Editor`) — there is no group CRUD yet, matching the server. A non-admin group's user is scoped to one campus or "All campuses"; an admin group always sees every campus. - `DashboardScreen`: the Devices/IP rules/Media/Playlists/Users/ Settings tabs and the routes behind them are gated by the signed-in user's permissions. IP rules needs `devices_approve`, Settings and Users need `settings_manage`/`users_manage` — a Campus Editor sees neither tab, and typing the URL directly shows "You do not have permission to view this page" instead of the screen. - `SessionUser` now carries `isAdmin`, `campusId` and `permissions`, parsed from the server's `UserView` (`is_admin`, `campus_id`, `permissions` — GRI-1970, already in `dev`). - New read-only `campusApi` and `userGroupsApi` modules back the create/edit form's campus and role selects. API tokens are explicitly out of scope for this release (not needed for the one-campus test); left for a follow-up. ## Testing No QA-authored frontend tests exist for this screen; this repo's convention has the frontend engineer write vitest tests alongside each screen (GRI-1764), with QA owning backend acceptance tests (e.g. GRI-1971). `UsersScreen.test.tsx` and `DashboardScreen.test.tsx` cover: loading/empty/error states, create/edit/delete, duplicate email, an admin-group campus refusal, and the permission-gated nav and routing. `scripts/local-gates.sh --frontend-only`: prettier, oxlint (`--deny-warnings`), `tsc -b`, the full vitest suite (48 passed) and `vite build` all passed. I could not drive the app in a real browser in this sandbox (no Playwright/Chromium available, no network to fetch one) — the states above are verified through jsdom-rendered component tests with real user interaction (`@testing-library/user-event`), not a screenshot. Closes #52.
GRI-1978: panel user and role management, permission-gated nav
Some checks failed
CI / cargo fmt (pull_request) Successful in 9s
CI / the pre-push hook (pull_request) Successful in 10s
CI / cargo deny advisories (pull_request) Failing after 1m50s
CI / cargo deny (pull_request) Successful in 1m52s
CI / repository boundary (pull_request) Successful in 44s
CI / cargo clippy (pull_request) Successful in 2m49s
CI / frontend-web (pull_request) Successful in 1m43s
CI / cargo test (pull_request) Successful in 3m48s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 10s
d7208c7a99
Users screen (list, create, edit, delete) for admins, with a fixed
role (Admin, Campus Editor) and a campus assigned per user, against
the server contract from GRI-1970 (PR #168). The Devices/IP rules/
Settings/Users tabs and routes are now gated by the signed-in user's
permissions, so IP rules and Settings disappear for a Campus Editor
and a typed-in URL does not reach them either. API tokens are left
for later, per the chief of staff's release note on forge issue #52.
vivy merged commit 441951bde6 into dev 2026-11-14 00:42:27 +00:00
vivy deleted branch feature/GRI-1978-panel-users-permissions 2026-11-14 00:42:27 +00: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
Grimoirix/grimoire-of-digital-signage!173
No description provided.