A nav item says which permission its page needs
All checks were successful
CI / naming (push) Successful in 3s
CI / frontend (push) Successful in 12s
CI / migrations-mysql (push) Successful in 39s
CI / backend (push) Successful in 3m43s

The sidebar hides what the caller cannot reach - that is what makes it useful
to a guest, and what stops a member with a sparse role being offered links that
can only answer 403. It reads the permission off the nav item to decide.

Only four items ever declared one. Machines, PCs, Printers, Network, USB,
Knowledge Base, Notifications, Calendar, Dashboard, Map, Applications and
Reports declared nothing, so the filter had nothing to go on: granting the
guest role machines.view opened the API and left the sidebar empty, which reads
as the grant not working.

Every item now names its read permission - in the plugins, in the core
navigation endpoint, and in the frontend's fallback list, which is what renders
when the endpoint is unreachable and would otherwise disagree with it.
This commit is contained in:
cproudlock
2026-08-27 14:50:52 -04:00
parent afce24379c
commit 4e59fe30b2
12 changed files with 45 additions and 16 deletions

View File

@@ -115,6 +115,15 @@ ADR-007 and ADR-002.
### Fixed
- **The sidebar offered pages the reader could not open, and hid ones they
could.** A nav item is hidden from anybody who does not hold its permission,
but only four items ever declared one - so the filter did nothing for the
rest, and a signed-out visitor granted `machines.view` still saw an empty
sidebar. Every item now names the read permission its page needs, in the
plugins, in the core navigation endpoint and in the frontend's fallback list.
A signed-in member with a sparse role will notice the same correction: a link
that could only answer 403 no longer appears.
- **Every report offers to email itself, not just two of them.** `POST
/api/reports/email` has always taken any `{columns, rows}`, but the button was
on the toner and warranty pages only - because those two happen to be their