From d98a42e34f942c0475a485fa5f14faac2a659514 Mon Sep 17 00:00:00 2001 From: Chareice Date: Thu, 18 Jan 2024 13:48:28 +0800 Subject: [PATCH] chore: acl --- packages/core/server/src/middlewares/acl-selector.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/core/server/src/middlewares/acl-selector.ts b/packages/core/server/src/middlewares/acl-selector.ts index ba72e44bb8..524041697c 100644 --- a/packages/core/server/src/middlewares/acl-selector.ts +++ b/packages/core/server/src/middlewares/acl-selector.ts @@ -1,9 +1,13 @@ export function AclSelectorMiddleware() { return async (ctx, next) => { const connectionName = ctx.get('x-connection'); - const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl; + if (connectionName) { + await next(); + } else { + const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl; - const middleware = aclInstance.middleware(); - await middleware(ctx, next); + const middleware = aclInstance.middleware(); + await middleware(ctx, next); + } }; }