mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
fix: 修复角色更新、删除权限控制
This commit is contained in:
@@ -31,6 +31,7 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
relationConfig: {
|
||||
disabled: !this.$hasPerm('rbac.add_systemrolebinding'),
|
||||
icon: 'fa-user',
|
||||
title: this.$t('common.Members'),
|
||||
objectsAjax: {
|
||||
|
||||
@@ -36,10 +36,10 @@ export default {
|
||||
activeMenu: 'RoleInfo',
|
||||
actions: {
|
||||
canDelete: () => {
|
||||
return vm.hasPermNotBuiltinNotRootOrg(this.role, `rbac.delete_${scopeRole}`)
|
||||
return vm.hasPermNotBuiltin(this.role, `rbac.delete_${scopeRole}`)
|
||||
},
|
||||
canUpdate: () => {
|
||||
return vm.hasPermNotBuiltinNotRootOrg(this.role, `rbac.change_${scopeRole}`)
|
||||
return vm.hasPermNotBuiltin(this.role, `rbac.change_${scopeRole}`)
|
||||
},
|
||||
updateRoute: {
|
||||
name: this.$route.name.replace('Detail', 'Update'),
|
||||
@@ -62,10 +62,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasPermNotBuiltinNotRootOrg(row, perm) {
|
||||
return !row['builtin'] &&
|
||||
this.$hasPerm(perm) &&
|
||||
!this.$isRootOrg()
|
||||
hasPermNotBuiltin(row, perm) {
|
||||
return !row['builtin'] && this.$hasPerm(perm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ export default {
|
||||
actions: {
|
||||
formatterArgs: {
|
||||
canUpdate: ({ row }) => {
|
||||
return this.hasPermNotBuiltinNotRootOrg(row, `rbac.change_${row.scope}role`)
|
||||
return this.hasPermNotBuiltin(row, `rbac.change_${row.scope}role`)
|
||||
},
|
||||
canDelete: ({ row }) => {
|
||||
return this.hasPermNotBuiltinNotRootOrg(row, `rbac.delete_${row.scope}role`)
|
||||
return this.hasPermNotBuiltin(row, `rbac.delete_${row.scope}role`)
|
||||
},
|
||||
updateRoute: {
|
||||
name: 'RoleUpdate',
|
||||
@@ -108,8 +108,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasPermNotBuiltinNotRootOrg(row, perm) {
|
||||
return !row['builtin'] && this.$hasPerm(perm) && !this.$isRootOrg()
|
||||
hasPermNotBuiltin(row, perm) {
|
||||
return !row['builtin'] && this.$hasPerm(perm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
}
|
||||
},
|
||||
hidden: () => {
|
||||
return !this.$hasPerm('rbac.change_systemrolebinding')
|
||||
return !this.$hasPerm('rbac.add_systemrolebinding')
|
||||
},
|
||||
value: []
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user