1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-09-27 00:00:01 +08:00

validate personal lock by role (#248)

This commit is contained in:
Leonel Matos 2020-01-22 17:32:00 -04:00 committed by Yamel Senih
parent 16e988cc6a
commit 758fc12796

View File

@ -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
})
}
}
}
}