Staaarter

Access Denied With Request Path

A permissions error naming the specific missing role and the path that was blocked, with a list of the people who can grant it (with portraits), and a Request access card on an image tile that swaps to a Requested confirmation state on click.

By Staaarter Team
Error
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, avatar, avatar-initials, media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/access-denied-with-request-path.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/error/error37.tsx instead.

Usage

The file also exports error37Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Error37, error37Demo } from "@/components/blocks/error/error37";

export default function Page() {
  return <Error37 {...error37Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstring"403"Small uppercase label above the headline.
headingstring"You don't have access"Main headline.
descriptionstringnoneSupporting copy under the headline; defaults to a sentence built from missingRole when omitted.
missingRolestringnoneName of the role required to view the page.
requestedPathstring"/admin/billing"The path the visitor tried to reach, shown in a monospace chip.
grantorsGrantor[]nonePeople who can grant the missing role, each with a portrait.
imageMediaSlotImagenoneBackground image for the request-access tile.
requestLabelstring"Request access"Label for the request button before it's clicked.
requestedLabelstring"Requested"Badge label shown after the request is made.
classNamestringnoneExtra classes for the outer section element.

Types

interface Grantor {
  name: string;
  role: string;
  avatar?: { src: string; alt: string };
}

Behavior notes

  • "Request access" is real local client state: clicking it flips a boolean and swaps the button for a "Requested" badge, but no request is actually sent anywhere, there's no backend behind it.
  • Each grantor's Avatar falls back to initials derived from their name when no portrait is supplied.
  • The requested-path chip and the missing-role text are plain demo strings, not derived from a real route or permissions check.