Context. surface studio · domain governance · route /studio/rbac-permission-policy · auth signed-in + studio entitlement · source apps/oshun/web/src/app/studio/rbac-permission-policy/page.tsx
Last walked. 2026-07-03 real-infra Playwright walk — anonymous redirect, admin catalog load, live RBAC evaluation, deny override, wildcard allow, default deny, unknown-role issues, client JSON validation, live BFF 400 detail, loading/503/malformed/network failures, pending-submit lockout, non-admin fail-closed auth, quick-action targets, 44 px controls, and mobile containment verified in Chromium. Evidence: apps/oshun/web/e2e/studio-rbac-permission-policy.spec.ts and WALKTHROUGH/results/v1-real-infra-run-2026-06-22.md
Purpose#
Evaluate access requests with the real RBAC policy evaluator: the Policy
Evaluation Lane applies role-inheritance closure, action wildcard matching, and
deny-override precedence (explicit deny beats allow; no matching rule is a
default deny). It is a live admin console wired to
/v1/admin/studio/rbac-policy, not an in-page simulation.
Entry points#
- Direct URL / bookmark —
/studio/rbac-permission-policy(signed-in + studio entitlement; admin scope required to evaluate) - Sibling Studio routes — reached via the quick-action panel on color-system, authentication-architecture, enterprise-tenant-isolation, and other governance pages
Layout regions#
page.tsx mounts <ShellLayout active="studio"> and renders
<StudioRbacPermissionPolicyUxWorkspace /> followed by a single panel of
quick-action links.
- Shell:
ShellLayoutchrome with the Studio tab active - Workspace heading:
WorkspaceHeadingrenders the page<h1>"Studio RBAC Permission Policy", followed by thedata-rbac-permission-policy-ux-summaryparagraph - Policy Evaluation Lane: an
<h2>data-rbac-lane-heading("Policy Evaluation Lane") section with the load states and, when ready, the evaluate form and result - Quick-actions panel: 7 sibling
quickActionLinks — Enterprise Tenant Isolation, Audit and Compliance Surfaces, Notification Center, Activity and Change Feeds, "Back to Session and Device Management workspace", "Back to Authentication Architecture workspace", and "Back to Multi-Project Operations workspace". No self-link and no Route Map panel.
States#
- Loading —
data-rbac-loading("Loading policy evaluator…") - Unauthorized —
data-rbac-unauthorized("Access restricted.") on 401/403 - Error —
data-rbac-error("Could not load the policy evaluator.") - Ready / form —
data-rbac-enums("N effects · M decision reasons") plus thedata-rbac-formevaluate form - Pending evaluate —
data-rbac-form-state="pending",data-rbac-submit-state="pending", disabled submit,aria-busy="true" - Result —
data-rbac-resultheadline (data-rbac-headlinewithdata-rbac-allow-count,data-rbac-deny-count), thedata-rbac-decisionstable ofdata-rbac-decision-rowrows (data-rbac-decision-reason), and an optionaldata-rbac-issueslist ofdata-rbac-issue-rowitems - Evaluate error —
data-rbac-evaluate-errorfor invalid JSON or a non-200 response
Interactions#
- Policy (JSON) —
textareadata-rbac-payload,aria-label="rbac policy json", seeded with roles containing{ roleId, permissions[{ action, effect }], inherits[] }and requests containing{ requestId, subjectRoles[], action } - Evaluate policy —
buttondata-rbac-submit(type="submit"); POSTs the parsed JSON to/v1/admin/studio/rbac-policy/evaluate, settingdata-rbac-resulton a 200 with a validresult, ordata-rbac-evaluate-errorotherwise; disabled and busy while the POST is pending - Quick-action links — each
quickActionLinknavigates to its sibling Studio route (see Layout regions for the 7 targets) - Mobile containment — 390 px viewport has no horizontal overflow; policy textarea, submit, and quick actions meet 44 px minimum target size
Data & contracts#
- Reads:
GET /v1/admin/studio/rbac-policyon mount — returns the catalog (permissionEffects[],decisionReasons[]) - Writes:
POST /v1/admin/studio/rbac-policy/evaluate— returns{ result: { results[], allowCount, denyCount, issues[] } } - Realtime: none
- Caching: client
fetchwithcache: 'no-store';buildBffAuthHeaders()attaches the bearer token - Auth/role check: admin-scoped fail-closed —
admin:*oradmin:studio, 401/403 under the studio workspace gate
Cross-references#
- Parent:
../studio-overview.md - Sibling:
studio-authentication-architecture.md,studio-enterprise-tenant-isolation.md,studio-audit-compliance-surfaces.md - Component source:
apps/oshun/web/src/components/studio/StudioRbacPermissionPolicyUxWorkspace.tsx - BFF store:
apps/oshun/bff/src/studio/rbac-policy-store.tsbehind/v1/admin/studio/rbac-policy
Open questions / known gaps#
- Confirm whether the page will gain a breadcrumb/Route Map panel like other Studio surfaces, or keep the flat quick-action panel
- Document the live role catalog the evaluator should be seeded from once the lane drives production RBAC decisions