Don't allow users to remove their account or user. (#7242)

This commit is contained in:
Sina Kashipazha 2023-04-17 14:15:57 +02:00 committed by GitHub
parent 2fc879d5f1
commit b866e40d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -195,9 +195,8 @@ export default {
label: 'label.action.delete.account',
message: 'message.delete.account',
dataView: true,
show: (record, store) => {
return ['Admin', 'DomainAdmin'].includes(store.userInfo.roletype) && !record.isdefault &&
!(record.domain === 'ROOT' && record.name === 'admin' && record.accounttype === 1)
disabled: (record, store) => {
return record.id !== 'undefined' && store.userInfo.accountid === record.id
},
groupAction: true,
popup: true,

View File

@ -144,9 +144,8 @@ export default {
label: 'label.action.delete.user',
message: 'message.delete.user',
dataView: true,
show: (record, store) => {
return ['Admin', 'DomainAdmin'].includes(store.userInfo.roletype) && !record.isdefault &&
!(record.domain === 'ROOT' && record.account === 'admin' && record.accounttype === 1)
disabled: (record, store) => {
return record.id !== 'undefined' && store.userInfo.id === record.id
}
}
]