提交 a9c395cc 编写于 作者: S shiziyuan9527 提交者: 刘瑞斌

fix(用户组和权限): 用户组修改

上级 a3fd15fd
......@@ -107,6 +107,9 @@ public class GroupService {
}
public void editGroup(EditGroupRequest request) {
if (StringUtils.equals(request.getId(), "admin")) {
MSException.throwException("系统管理员无法编辑!");
}
checkGroupExist(request);
Group group = new Group();
request.setScopeId(null);
......@@ -116,6 +119,9 @@ public class GroupService {
}
public void deleteGroup(String id) {
if (StringUtils.equals(id, "admin")) {
MSException.throwException("系统管理员无法删除!");
}
groupMapper.deleteByPrimaryKey(id);
UserGroupPermissionExample example = new UserGroupPermissionExample();
example.createCriteria().andGroupIdEqualTo(id);
......
<template>
<el-dialog :close-on-click-modal="false" :visible.sync="dialogVisible" width="50%"
:title="dialogTitle"
:title="title"
:destroy-on-close="true">
<el-form ref="form" :model="form" label-width="auto" size="small" :rules="rules">
<el-row>
......@@ -11,7 +11,7 @@
</el-col>
<el-col :span="11" :offset="2">
<el-form-item label="所属类型" prop="type">
<el-select v-model="form.type" placeholder="请选择所属类型" style="width: 100%" @change="changeGroup">
<el-select v-model="form.type" placeholder="请选择所属类型" style="width: 100%" @change="changeGroup" :disabled="dialogType === 'edit'">
<el-option label="系统" value="SYSTEM"></el-option>
<el-option label="组织" value="ORGANIZATION"></el-option>
<el-option label="工作空间" value="WORKSPACE"></el-option>
......@@ -70,7 +70,8 @@ export default {
dialogType: '',
isSystem: false,
show: true,
organizations: []
organizations: [],
title: '创建用户组'
}
},
props: {
......@@ -117,7 +118,8 @@ export default {
this.dialogVisible = false;
})
},
open(row, type) {
open(row, type, title) {
this.title = title;
this.isSystem = false;
this.show = true;
this.dialogVisible = true;
......
......@@ -102,10 +102,14 @@ export default {
});
},
create() {
this.$refs.editUserGroup.open({}, 'create');
this.$refs.editUserGroup.open({}, 'create', '创建用户组');
},
edit(row) {
this.$refs.editUserGroup.open(row, 'edit');
if (row.id === "admin") {
this.$warning("系统管理员不支持编辑!");
return ;
}
this.$refs.editUserGroup.open(row, 'edit', '编辑用户组');
},
_handleDel(row) {
this.result = this.$get("/user/group/delete/" + row.id, () => {
......@@ -114,6 +118,10 @@ export default {
});
},
del(row) {
if (row.id === "admin") {
this.$warning("系统管理员不支持删除!");
return ;
}
this.$refs.deleteConfirm.open(row);
},
copy(row) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册