refactor: rename permission to visibilityPermission
Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
'@backstage/backend-plugin-api': minor
|
||||
---
|
||||
|
||||
Added optional `permission` field to `ActionsRegistryActionOptions`, allowing actions to declare a `BasicPermission` that controls visibility and access.
|
||||
Added optional `visibilityPermission` field to `ActionsRegistryActionOptions`, allowing actions to declare a `BasicPermission` that controls visibility and access.
|
||||
|
||||
```typescript
|
||||
import { createPermission } from '@backstage/plugin-permission-common';
|
||||
@@ -16,7 +16,7 @@ actionsRegistry.register({
|
||||
name: 'my-action',
|
||||
title: 'My Action',
|
||||
description: 'An action that requires permission',
|
||||
permission: myPermission,
|
||||
visibilityPermission: myPermission,
|
||||
schema: {
|
||||
input: z => z.object({ name: z.string() }),
|
||||
output: z => z.object({ ok: z.boolean() }),
|
||||
@@ -27,4 +27,4 @@ actionsRegistry.register({
|
||||
});
|
||||
```
|
||||
|
||||
Actions without a `permission` field continue to work as before.
|
||||
Actions without a `visibilityPermission` field continue to work as before.
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
'@backstage/backend-defaults': patch
|
||||
---
|
||||
|
||||
Added permissions integration to the actions registry. Actions registered with a `permission` field are now checked against the permissions framework when listing and invoking. Denied actions are filtered from list results, and invoking a denied action returns a `404 Not Found` as if the action does not exist. Permissions are automatically registered with the `PermissionsRegistryService` so they appear in the permission policy system.
|
||||
Added permissions integration to the actions registry. Actions registered with a `visibilityPermission` field are now checked against the permissions framework when listing and invoking. Denied actions are filtered from list results, and invoking a denied action returns a `404 Not Found` as if the action does not exist. Permissions are automatically registered with the `PermissionsRegistryService` so they appear in the permission policy system.
|
||||
|
||||
Reference in New Issue
Block a user