Panel: assign a device to a campus #225

Closed
opened 2026-11-15 16:53:02 +00:00 by vivy · 2 comments
Owner

The server already accepts campus_id in PATCH /devices/{id} (UpdateDeviceRequest). The panel has no control for it, so the product owner cannot move a device to a campus.

Expected: on the Devices screen a global admin can pick the campus of a device (dropdown of campuses). A campus admin sees only their own campus. Test both roles.

The server already accepts `campus_id` in `PATCH /devices/{id}` (`UpdateDeviceRequest`). The panel has no control for it, so the product owner cannot move a device to a campus. Expected: on the Devices screen a global admin can pick the campus of a device (dropdown of campuses). A campus admin sees only their own campus. Test both roles.
Member

Implemented: the Devices screen now has a Campus dropdown on each approved device.

  • A global admin (campusId null) sees every campus.
  • A campus-scoped admin sees only their own campus — the server's may_access check on PATCH /devices/{id} would refuse anything else, so the option list matches what the write would actually accept.
  • A user without devices_manage sees the campus as read-only text instead of a control.

PATCH /devices/{id} requires name, so the client resends the device's current name alongside campus_id.

Tests added to DevicesScreen.test.tsx: a global admin can assign to any of the 4 mock campuses, a campus admin sees only their own campus as the selectable option, and a user without devices_manage gets read-only text with no control.

scripts/local-gates.sh --frontend-only is green: prettier, oxlint, tsc -b, vitest run (99 passed), vite build.

PR: #238 (onto dev). CI is running.

Implemented: the Devices screen now has a Campus dropdown on each approved device. - A global admin (`campusId` null) sees every campus. - A campus-scoped admin sees only their own campus — the server's `may_access` check on `PATCH /devices/{id}` would refuse anything else, so the option list matches what the write would actually accept. - A user without `devices_manage` sees the campus as read-only text instead of a control. `PATCH /devices/{id}` requires `name`, so the client resends the device's current name alongside `campus_id`. Tests added to `DevicesScreen.test.tsx`: a global admin can assign to any of the 4 mock campuses, a campus admin sees only their own campus as the selectable option, and a user without `devices_manage` gets read-only text with no control. `scripts/local-gates.sh --frontend-only` is green: prettier, oxlint, `tsc -b`, `vitest run` (99 passed), `vite build`. PR: https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/pulls/238 (onto `dev`). CI is running.
Author
Owner

In dev via PR #238 (verified with fj landed). Closing for the Monday demo.

In dev via PR #238 (verified with fj landed). Closing for the Monday demo.
vivy closed this issue 2026-11-15 20:55:38 +00:00
Sign in to join this conversation.
No project
No assignees
2 participants
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#225
No description provided.