mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 03:35:10 +00:00
chore: acl selectore
This commit is contained in:
parent
d98a42e34f
commit
edad85b92d
@ -1,13 +1,9 @@
|
|||||||
export function AclSelectorMiddleware() {
|
export function AclSelectorMiddleware() {
|
||||||
return async (ctx, next) => {
|
return async (ctx, next) => {
|
||||||
const connectionName = ctx.get('x-connection');
|
const connectionName = ctx.get('x-connection');
|
||||||
if (connectionName) {
|
const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl;
|
||||||
await next();
|
|
||||||
} else {
|
|
||||||
const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl;
|
|
||||||
|
|
||||||
const middleware = aclInstance.middleware();
|
const middleware = aclInstance.middleware();
|
||||||
await middleware(ctx, next);
|
await middleware(ctx, next);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user