From d610297f8ccce634dd446fc16fcb482db154cb79 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 25 Nov 2022 09:31:57 +0800 Subject: [PATCH] fix(acl): exception thrown when role not found --- packages/plugins/acl/src/actions/role-check.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/plugins/acl/src/actions/role-check.ts b/packages/plugins/acl/src/actions/role-check.ts index e188ea7b1..bbbc05712 100644 --- a/packages/plugins/acl/src/actions/role-check.ts +++ b/packages/plugins/acl/src/actions/role-check.ts @@ -33,6 +33,8 @@ export async function checkAction(ctx, next) { allowMenuItemIds: roleInstance.get('menuUiSchemas').map((uiSchema) => uiSchema.get('x-uid')), allowAnonymous: !!anonymous, }; + } else { + throw new Error('Role not found'); } await next();