From 758fc12796bf77c33a1aa9efcd5bf5c0cb604763 Mon Sep 17 00:00:00 2001 From: Leonel Matos Date: Wed, 22 Jan 2020 17:32:00 -0400 Subject: [PATCH] validate personal lock by role (#248) --- .../ADempiere/ContextMenu/contextMenuMixin.js | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/src/components/ADempiere/ContextMenu/contextMenuMixin.js b/src/components/ADempiere/ContextMenu/contextMenuMixin.js index 87cb7f39..f82c2c74 100644 --- a/src/components/ADempiere/ContextMenu/contextMenuMixin.js +++ b/src/components/ADempiere/ContextMenu/contextMenuMixin.js @@ -612,40 +612,42 @@ export const contextMixin = { }) }, validatePrivateAccess({ isLocked, tableName, recordId }) { - if (isLocked) { - this.actions = this.actions.map(actionItem => { - if (actionItem.action === 'unlockRecord') { - return { - ...actionItem, - hidden: false, - tableName, - recordId + if (this.isPersonalLock) { + if (isLocked) { + this.actions = this.actions.map(actionItem => { + if (actionItem.action === 'unlockRecord') { + return { + ...actionItem, + hidden: false, + tableName, + recordId + } + } else if (actionItem.action === 'lockRecord') { + return { + ...actionItem, + hidden: true + } } - } else if (actionItem.action === 'lockRecord') { - return { - ...actionItem, - hidden: true + return actionItem + }) + } else { + this.actions = this.actions.map(actionItem => { + if (actionItem.action === 'lockRecord') { + return { + ...actionItem, + hidden: false, + tableName, + recordId + } + } else if (actionItem.action === 'unlockRecord') { + return { + ...actionItem, + hidden: true + } } - } - return actionItem - }) - } else { - this.actions = this.actions.map(actionItem => { - if (actionItem.action === 'lockRecord') { - return { - ...actionItem, - hidden: false, - tableName, - recordId - } - } else if (actionItem.action === 'unlockRecord') { - return { - ...actionItem, - hidden: true - } - } - return actionItem - }) + return actionItem + }) + } } } }