diff --git a/modules/ticket/back/methods/ticket/componentUpdate.js b/modules/ticket/back/methods/ticket/componentUpdate.js index 2294e6d25..d9fe259ea 100644 --- a/modules/ticket/back/methods/ticket/componentUpdate.js +++ b/modules/ticket/back/methods/ticket/componentUpdate.js @@ -116,8 +116,8 @@ module.exports = Self => { if (!isEditable) throw new UserError(`The sales of this ticket can't be modified`); - const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss', myOptions); - if (!isProductionBoss) { + const isDeliveryBoss = await models.Account.hasRole(userId, 'deliveryBoss', myOptions); + if (!isDeliveryBoss) { const zoneShipped = await models.Agency.getShipped( args.landed, args.addressFk, diff --git a/modules/ticket/back/methods/ticket/isEditable.js b/modules/ticket/back/methods/ticket/isEditable.js index a444691ac..5b9a397a1 100644 --- a/modules/ticket/back/methods/ticket/isEditable.js +++ b/modules/ticket/back/methods/ticket/isEditable.js @@ -31,10 +31,10 @@ module.exports = Self => { }, myOptions); const isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant', myOptions); - const isProductionBoss = await Self.app.models.Account.hasRole(userId, 'productionBoss', myOptions); + const isDeliveryBoss = await Self.app.models.Account.hasRole(userId, 'deliveryBoss', myOptions); const isBuyer = await Self.app.models.Account.hasRole(userId, 'buyer', myOptions); - const isValidRole = isSalesAssistant || isProductionBoss || isBuyer; + const isValidRole = isSalesAssistant || isDeliveryBoss || isBuyer; let alertLevel = state ? state.alertLevel : null; let ticket = await Self.app.models.Ticket.findById(id, { diff --git a/modules/ticket/back/methods/ticket/priceDifference.js b/modules/ticket/back/methods/ticket/priceDifference.js index e0ffac55a..0e8cc2e06 100644 --- a/modules/ticket/back/methods/ticket/priceDifference.js +++ b/modules/ticket/back/methods/ticket/priceDifference.js @@ -78,8 +78,8 @@ module.exports = Self => { if (!isEditable) throw new UserError(`The sales of this ticket can't be modified`); - const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss', myOptions); - if (!isProductionBoss) { + const isDeliveryBoss = await models.Account.hasRole(userId, 'deliveryBoss', myOptions); + if (!isDeliveryBoss) { const zoneShipped = await models.Agency.getShipped( args.landed, args.addressId,