@backstage/plugin-permission-react
Home > @backstage/plugin-permission-react
Components and hooks to help implement permissions in Backstage frontend plugins.
Classes
Class |
Description |
---|---|
The default implementation of the PermissionApi, which simply calls the authorize method of the given PermissionClient. |
Functions
Function |
Description |
---|---|
Returns a React Router Route which only renders the element when authorized. If unauthorized, the Route will render a NotFoundErrorPage (see AppComponents). | |
A boundary that only renders its child elements if the user has the specified permission. While loading, nothing will be rendered. If the user does not have permission, the | |
React hook utility for authorization. Given either a non-resource Permission or a ResourcePermission and an optional resourceRef, it will return whether or not access is allowed (for the given resource, if resourceRef is provided). See for more details. The resourceRef field is optional to allow calling this hook with an entity that might be loading asynchronously, but when resourceRef is not supplied, the value of Note: This hook uses stale-while-revalidate to help avoid flicker in UI elements that would be conditionally rendered based on the |
Variables
Variable |
Description |
---|---|
A Backstage ApiRef for the Permission API. See https://backstage.io/docs/api/utility-apis for more information on Backstage ApiRefs. |
Type Aliases
Type Alias |
Description |
---|---|
This API is used by various frontend utilities that allow developers to implement authorization within their frontend plugins. A plugin developer will likely not have to interact with this API or its implementations directly, but rather with the aforementioned utility components/hooks. | |
Properties for RequirePermission() |