mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 05:25:13 +00:00
chore: test
This commit is contained in:
parent
1214717f82
commit
157e3d2ef9
@ -17,8 +17,8 @@ export function pageArgsToLimitArgs(
|
||||
export function getRepositoryFromParams(ctx: Context) {
|
||||
const { resourceName, resourceOf } = ctx.action;
|
||||
|
||||
const databaseName = ctx.get('x-database');
|
||||
const database = ctx.app.getDb(databaseName || 'main') as Database;
|
||||
const connectionName = ctx.get('x-connection');
|
||||
const database = ctx.app.getDb(connectionName || 'main') as Database;
|
||||
|
||||
if (resourceOf) {
|
||||
return database.getRepository<MultipleRelationRepository>(resourceName, resourceOf);
|
||||
|
@ -1,7 +1,7 @@
|
||||
export function AclSelectorMiddleware() {
|
||||
return async (ctx, next) => {
|
||||
const databaseName = ctx.get('x-database');
|
||||
const aclInstance = databaseName ? ctx.app.acls.get(databaseName) : ctx.app.acl;
|
||||
const connectionName = ctx.get('x-connection');
|
||||
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