Issue 203
bug: Signed-in residents see the Payload admin bar
Back to our planDone
bugfrontendauthpriority: high
Type
bug
Summary
Any signed-in user sees Payload's admin bar (Dashboard, New Page, Logout), though residents can't open the admin. It will confuse residents once accounts open (#187).
Problem
src/components/AdminBar/index.tsx:41 shows the bar for any signed-in user.
Found while taking the UI inventory (https://github.com/boulaajaj/sprecher-east-neighborhood-website/blob/main/docs/ui/evidence.md#bugs-found-while-taking-the-inventory, opens in a new tab, #170).
Proposed fix
Show the bar only to admins and editors, using isAdminOrEditor from src/access/roles.ts (or the role on the user the page already has).
Acceptance criteria
- Not done: A resident sees no admin bar; an editor and an admin still do.
- Not done: A unit test covers the role check.
Depends on
Before #187 (resident accounts).
Area
frontend, auth
Priority
priority: high
Generated by Claude Code, opens in a new tab