diff --git a/packages/core/server/src/middlewares/acl-selector.ts b/packages/core/server/src/middlewares/acl-selector.ts index 524041697c..ba72e44bb8 100644 --- a/packages/core/server/src/middlewares/acl-selector.ts +++ b/packages/core/server/src/middlewares/acl-selector.ts @@ -1,13 +1,9 @@ export function AclSelectorMiddleware() { return async (ctx, next) => { const connectionName = ctx.get('x-connection'); - if (connectionName) { - await next(); - } else { - const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl; + 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); }; }