From 90a19d52fb60fbf0fbdc07a107c1a58b06ce4a64 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 8 Apr 2022 09:02:27 +0200 Subject: [PATCH] use variable --- modules/client/back/methods/client/updateAddress.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/client/back/methods/client/updateAddress.js b/modules/client/back/methods/client/updateAddress.js index f7d1c1288..d7e20b876 100644 --- a/modules/client/back/methods/client/updateAddress.js +++ b/modules/client/back/methods/client/updateAddress.js @@ -89,12 +89,12 @@ module.exports = function(Self) { const args = ctx.args; const userId = ctx.req.accessToken.userId; const myOptions = {}; - const isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant', myOptions); + const isSalesAssistant = await models.Account.hasRole(userId, 'salesAssistant', myOptions); if (typeof options == 'object') Object.assign(myOptions, options); - if (ctx.args.isLogifloraAllowed && !isSalesAssistant) + if (args.isLogifloraAllowed && !isSalesAssistant) throw new UserError(`You don't have enough privileges`); const address = await models.Address.findOne({