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