From ee9fba212ce10a6bad1489677e480e497521efff Mon Sep 17 00:00:00 2001 From: alexandre Date: Fri, 3 Mar 2023 12:00:30 +0100 Subject: [PATCH] refs #4074 refactor user-acl --- back/methods/account/user-acl.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/back/methods/account/user-acl.js b/back/methods/account/user-acl.js index 687c536fa..e53e2aabf 100644 --- a/back/methods/account/user-acl.js +++ b/back/methods/account/user-acl.js @@ -24,18 +24,11 @@ module.exports = Self => { }); Self.userAcl = async function(ctx, aclList) { - let models = Self.app.models; - - let ACLs = []; + const ACLs = []; for (let key in aclList) { - let acl = await models.ACL.findOne({ - where: { - principalId: key, - } - }); - if (acl) - ACLs.push(acl); + const acl = await Self.app.models.ACL.findOne({where: {principalId: key}}); + if (acl) ACLs.push(acl); } return ACLs; };