mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 06:48:46 +00:00
chore: acl
This commit is contained in:
parent
738f9c568e
commit
d98a42e34f
@ -1,9 +1,13 @@
|
|||||||
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');
|
||||||
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();
|
const middleware = aclInstance.middleware();
|
||||||
await middleware(ctx, next);
|
await middleware(ctx, next);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user