mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 01:36:27 +00:00
chore: acl selectore
This commit is contained in:
parent
d98a42e34f
commit
edad85b92d
@ -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);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user