docs: add permissions documentation for actions registry
Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
+6
-3
@@ -16,6 +16,7 @@
|
||||
|
||||
import {
|
||||
AuthService,
|
||||
BackstageCredentials,
|
||||
HttpAuthService,
|
||||
LoggerService,
|
||||
PermissionsService,
|
||||
@@ -32,6 +33,8 @@ import {
|
||||
import { InputError, NotAllowedError, NotFoundError } from '@backstage/errors';
|
||||
import { AuthorizeResult } from '@backstage/plugin-permission-common';
|
||||
|
||||
type ActionEntry = [string, ActionsRegistryActionOptions<any, any>];
|
||||
|
||||
export class DefaultActionsRegistryService implements ActionsRegistryService {
|
||||
private actions: Map<string, ActionsRegistryActionOptions<any, any>> =
|
||||
new Map();
|
||||
@@ -196,9 +199,9 @@ export class DefaultActionsRegistryService implements ActionsRegistryService {
|
||||
}
|
||||
|
||||
private async filterByPermissions(
|
||||
entries: [string, ActionsRegistryActionOptions<any, any>][],
|
||||
credentials: Parameters<PermissionsService['authorize']>[1]['credentials'],
|
||||
): Promise<[string, ActionsRegistryActionOptions<any, any>][]> {
|
||||
entries: ActionEntry[],
|
||||
credentials: BackstageCredentials,
|
||||
): Promise<ActionEntry[]> {
|
||||
const permissionedEntries = entries.filter(
|
||||
([_, action]) => action.permission,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user