feat(admin): proper no-access page and a separate no-permission page #140

Merged
amiryahaya merged 2 commits from feat/admin-no-access-page into main 2026-10-31 05:00:26 +01:00
Owner

What

A signed-in admin-portal user with no admin role (a customer, a new account) saw one bare line. Now:

  • no admin role at all: heading "No access to the admin portal", an explanation (ask an administrator to invite you, or sign out and use another account) and a Sign out button;
  • an admin on a page their role lacks: a separate "No permission for this page" with a "Back to start" link. Before, that admin was wrongly told they had no portal access.

RequireAccess picks the kind; unit tests and the three e2e specs that looked for the old text were updated (the axe check of the page included).

Checked

  • Unit tests 236 pass, typecheck clean; full Playwright e2e (scripts/web-e2e.sh) passes: 104 passed, 1 skipped.
  • Real browser, real Zitadel: a verified customer lands on the new page (DB: verified email, 0 memberships).
  • Coverage: no Go change; make cover 91.6% (min 80%).

Review

Dual-pass (Ponytail complexity, then correctness reviewer): ready to merge. Adopted one minor (text no longer points at an empty menu).

Not done / risks

  • The page and the sidebar both have a "Sign out" button (same accessible name); a future e2e locator must be scoped to main.
  • No focus move or announcement to the new heading on arrival (same as other pages); phone width not looked at.

🤖 Generated with Claude Code

## What A signed-in admin-portal user with no admin role (a customer, a new account) saw one bare line. Now: - **no admin role at all**: heading "No access to the admin portal", an explanation (ask an administrator to invite you, or sign out and use another account) and a Sign out button; - **an admin on a page their role lacks**: a separate "No permission for this page" with a "Back to start" link. Before, that admin was wrongly told they had no portal access. `RequireAccess` picks the kind; unit tests and the three e2e specs that looked for the old text were updated (the axe check of the page included). ## Checked - Unit tests 236 pass, typecheck clean; full Playwright e2e (scripts/web-e2e.sh) passes: 104 passed, 1 skipped. - Real browser, real Zitadel: a verified customer lands on the new page (DB: verified email, 0 memberships). - Coverage: no Go change; `make cover` **91.6%** (min 80%). ## Review Dual-pass (Ponytail complexity, then correctness reviewer): ready to merge. Adopted one minor (text no longer points at an empty menu). ## Not done / risks - The page and the sidebar both have a "Sign out" button (same accessible name); a future e2e locator must be scoped to `main`. - No focus move or announcement to the new heading on arrival (same as other pages); phone width not looked at. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A signed-in user with no admin role (a customer, a new account) now gets a heading,
an explanation and a sign-out button. An admin who opens a page their role does not
include gets a link home instead of being told they have no portal access.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fix(admin): no-permission text does not point at an empty menu
All checks were successful
ci / changes (pull_request) Successful in 14s
ci / api (pull_request) Has been skipped
ci / clients (pull_request) Has been skipped
ci / web (pull_request) Successful in 9m57s
ci / ci-gate (pull_request) Successful in 5s
80a4dd8231
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
primatekuntech/kws!140
No description provided.