fix(用户组与权限): 权限编辑
This commit is contained in:
parent
0aac4ed341
commit
d0cf2b0b33
|
@ -108,12 +108,14 @@
|
|||
{
|
||||
"id": "SYSTEM_QUOTA:READ",
|
||||
"name": "permission.system_quota.read",
|
||||
"resourceId": "SYSTEM_QUOTA"
|
||||
"resourceId": "SYSTEM_QUOTA",
|
||||
"license": true
|
||||
},
|
||||
{
|
||||
"id": "SYSTEM_QUOTA:READ+EDIT",
|
||||
"name": "permission.system_quota.edit",
|
||||
"resourceId": "SYSTEM_QUOTA"
|
||||
"resourceId": "SYSTEM_QUOTA",
|
||||
"license": true
|
||||
},
|
||||
{
|
||||
"id": "SYSTEM_AUTH:READ",
|
||||
|
@ -337,7 +339,8 @@
|
|||
},
|
||||
{
|
||||
"id": "SYSTEM_QUOTA",
|
||||
"name": "permission.system_quota.name"
|
||||
"name": "permission.system_quota.name",
|
||||
"license": true
|
||||
},
|
||||
{
|
||||
"id": "SYSTEM_AUTH",
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
<template>
|
||||
<div>
|
||||
<span v-for="(permission, index) in permissions" :key="index">
|
||||
<el-checkbox v-if="permission.license" v-xpack class="permission-checkbox"
|
||||
v-model="permission['checked']" @change="change($event, permission)" :disabled="readOnly">
|
||||
{{ $t(permission.name) }}
|
||||
</el-checkbox>
|
||||
<el-checkbox v-else class="permission-checkbox"
|
||||
v-model="permission['checked']" @change="change($event, permission)" :disabled="isReadOnly(permission)">
|
||||
<el-checkbox
|
||||
class="permission-checkbox"
|
||||
v-model="permission['checked']"
|
||||
@change="change($event, permission)"
|
||||
:disabled="isReadOnly(permission)">
|
||||
{{ $t(permission.name) }}
|
||||
</el-checkbox>
|
||||
</span>
|
||||
|
@ -20,13 +19,13 @@ export default {
|
|||
permissions: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
return [];
|
||||
}
|
||||
},
|
||||
selected: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
return [];
|
||||
}
|
||||
},
|
||||
readOnly: {
|
||||
|
@ -45,7 +44,7 @@ export default {
|
|||
computed: {
|
||||
isReadOnly() {
|
||||
return function (permission) {
|
||||
// 禁止取消系统管理员用户组的读取和设置权限
|
||||
// 禁止取消系统管理员用户组和超级管理员用户组的读取和设置权限
|
||||
const isSystemGroupPermission = permission.id === 'SYSTEM_GROUP:READ' || permission.id === 'SYSTEM_GROUP:READ+SETTING_PERMISSION';
|
||||
const isDefaultSystemGroup = (this.group.id === 'admin' || this.group.id === 'super_group') && isSystemGroupPermission;
|
||||
return this.readOnly || isDefaultSystemGroup;
|
||||
|
|
Loading…
Reference in New Issue