fix: isCurrentUser context params
This commit is contained in:
parent
b9f3acf05d
commit
1f82a97eb9
@ -593,12 +593,6 @@ export class PluginACL extends Plugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const collection = ctx.db.getCollection(resourceName);
|
|
||||||
|
|
||||||
if (!collection) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx.status !== 200) {
|
if (ctx.status !== 200) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -607,6 +601,12 @@ export class PluginACL extends Plugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const collection = ctx.db.getCollection(resourceName);
|
||||||
|
|
||||||
|
if (!collection) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const Model = collection.model;
|
const Model = collection.model;
|
||||||
|
|
||||||
const primaryKeyField = Model.primaryKeyField || Model.primaryKeyAttribute;
|
const primaryKeyField = Model.primaryKeyField || Model.primaryKeyAttribute;
|
||||||
@ -667,6 +667,7 @@ export class PluginACL extends Plugin {
|
|||||||
actionCtx.permission?.can === null && !actionCtx.permission.skip
|
actionCtx.permission?.can === null && !actionCtx.permission.skip
|
||||||
? null
|
? null
|
||||||
: actionCtx.permission?.parsedParams || {},
|
: actionCtx.permission?.parsedParams || {},
|
||||||
|
actionCtx,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -676,7 +677,7 @@ export class PluginACL extends Plugin {
|
|||||||
|
|
||||||
const allAllowed = [];
|
const allAllowed = [];
|
||||||
|
|
||||||
for (const [action, params] of actionsParams) {
|
for (const [action, params, actionCtx] of actionsParams) {
|
||||||
if (!params) {
|
if (!params) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -686,7 +687,10 @@ export class PluginACL extends Plugin {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryParams = collection.repository.buildQueryOptions(params);
|
const queryParams = collection.repository.buildQueryOptions({
|
||||||
|
...params,
|
||||||
|
context: actionCtx,
|
||||||
|
});
|
||||||
|
|
||||||
const actionSql = ctx.db.sequelize.queryInterface.queryGenerator.selectQuery(
|
const actionSql = ctx.db.sequelize.queryInterface.queryGenerator.selectQuery(
|
||||||
Model.getTableName(),
|
Model.getTableName(),
|
||||||
|
Loading…
Reference in New Issue
Block a user