validate personal lock by role (#248)
parent
16e988cc6a
commit
758fc12796
|
@ -612,40 +612,42 @@ export const contextMixin = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
validatePrivateAccess({ isLocked, tableName, recordId }) {
|
validatePrivateAccess({ isLocked, tableName, recordId }) {
|
||||||
if (isLocked) {
|
if (this.isPersonalLock) {
|
||||||
this.actions = this.actions.map(actionItem => {
|
if (isLocked) {
|
||||||
if (actionItem.action === 'unlockRecord') {
|
this.actions = this.actions.map(actionItem => {
|
||||||
return {
|
if (actionItem.action === 'unlockRecord') {
|
||||||
...actionItem,
|
return {
|
||||||
hidden: false,
|
...actionItem,
|
||||||
tableName,
|
hidden: false,
|
||||||
recordId
|
tableName,
|
||||||
|
recordId
|
||||||
|
}
|
||||||
|
} else if (actionItem.action === 'lockRecord') {
|
||||||
|
return {
|
||||||
|
...actionItem,
|
||||||
|
hidden: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (actionItem.action === 'lockRecord') {
|
return actionItem
|
||||||
return {
|
})
|
||||||
...actionItem,
|
} else {
|
||||||
hidden: true
|
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
|
})
|
||||||
})
|
}
|
||||||
} 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
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue