Fix sanitize input not using the right subject

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-11-27 11:52:00 +01:00
parent 0ba3f0746d
commit 6d39f0e772

View File

@ -34,7 +34,7 @@ const createPermissionChecker = ({ userAbility, model }) => {
const sanitizeInput = (action, data, entity) => {
return permissionsManager.sanitize(data, {
subject: entity ? toSubject(entity) : toSubject(data),
subject: entity ? toSubject(entity) : model,
action,
isOutput: false,
});