fix(docs): Fixed the code example for the Permissions - Frontend Integration
The current default code is exactly what it is in this example, except for the flawed import. Signed-off-by: Valentin Grégoire <32612304+valentingregoire@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b2fbe64f58
commit
046d2177bc
@@ -13,16 +13,11 @@ However, there are some cases where the integrator needs to supplement the polic
|
||||
If your Backstage permission policy may return a `DENY` for users requesting the `catalogEntityCreatePermission`, it may make sense, for example, to remove access to the `/catalog-import` page entirely:
|
||||
|
||||
```tsx title="packages/app/src/App.tsx"
|
||||
/* highlight-add-start */
|
||||
import { RequirePermission } from '@backstage/plugin-permission-react';
|
||||
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
|
||||
/* highlight-add-end */
|
||||
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
|
||||
|
||||
const routes = (
|
||||
<FlatRoutes>
|
||||
{/* highlight-remove-next-line */}
|
||||
<Route path="/catalog-import" element={<CatalogImportPage />} />
|
||||
{/* highlight-add-start */}
|
||||
<Route
|
||||
path="/catalog-import"
|
||||
element={
|
||||
@@ -31,7 +26,6 @@ const routes = (
|
||||
</RequirePermission>
|
||||
}
|
||||
/>
|
||||
{/* highlight-add-end */}
|
||||
{/* ... */}
|
||||
</FlatRoutes>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user