Skip to main content

PermissionedRoute()

Home > @backstage/plugin-permission-react > PermissionedRoute

Warning: This API is now obsolete.

This component no longer works with the most recent version of @backstage/core-app-api and react-router v6, use RequirePermission() instead.

Returns a React Router Route which only renders the element when authorized. If unauthorized, the Route will render a NotFoundErrorPage (see AppComponents).

Signature:

PermissionedRoute: (props: {
caseSensitive?: boolean;
children?: ReactNode;
element?: ReactElement | null;
path?: string;
errorComponent?: ReactElement | null;
} & ({
permission: Exclude<Permission, ResourcePermission>;
resourceRef?: never;
} | {
permission: ResourcePermission;
resourceRef: string | undefined;
})) => React.JSX.Element

Parameters

Parameter

Type

Description

props

{ caseSensitive?: boolean; children?: ReactNode; element?: ReactElement | null; path?: string; errorComponent?: ReactElement | null; } & ({ permission: Exclude<Permission, ResourcePermission>; resourceRef?: never; } | { permission: ResourcePermission; resourceRef: string | undefined; })

**Returns:**

React.JSX.Element