diff --git a/backend/src/main/java/io/metersphere/controller/GroupController.java b/backend/src/main/java/io/metersphere/controller/GroupController.java index 0af578080a..c3f1dbe350 100644 --- a/backend/src/main/java/io/metersphere/controller/GroupController.java +++ b/backend/src/main/java/io/metersphere/controller/GroupController.java @@ -41,9 +41,15 @@ public class GroupController { groupService.deleteGroup(id); } - @GetMapping("/permission") - public GroupPermissionDTO getGroupResource() { - return groupService.getGroupResource(); + @PostMapping("/permission") + public GroupPermissionDTO getGroupResource(@RequestBody Group group) { + return groupService.getGroupResource(group); } + @PostMapping("/permission/edit") + public void EditGroupPermission(@RequestBody EditGroupRequest editGroupRequest) { + groupService.editGroupPermission(editGroupRequest); + } + + } diff --git a/backend/src/main/java/io/metersphere/controller/request/group/EditGroupRequest.java b/backend/src/main/java/io/metersphere/controller/request/group/EditGroupRequest.java index e6ebaae375..cc8e2eab57 100644 --- a/backend/src/main/java/io/metersphere/controller/request/group/EditGroupRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/group/EditGroupRequest.java @@ -1,6 +1,7 @@ package io.metersphere.controller.request.group; import io.metersphere.base.domain.Group; +import io.metersphere.dto.GroupPermission; import lombok.Getter; import lombok.Setter; @@ -20,4 +21,8 @@ public class EditGroupRequest extends Group { * 是否是全局用户组 */ private Boolean global; + + private List permissions; + private String userGroupId; + } diff --git a/backend/src/main/java/io/metersphere/dto/GroupPermission.java b/backend/src/main/java/io/metersphere/dto/GroupPermission.java index 423893bef7..7971ea4c4d 100644 --- a/backend/src/main/java/io/metersphere/dto/GroupPermission.java +++ b/backend/src/main/java/io/metersphere/dto/GroupPermission.java @@ -7,4 +7,5 @@ public class GroupPermission { private String id; private String name; private String resourceId; + private Boolean checked = false; } diff --git a/backend/src/main/java/io/metersphere/service/GroupService.java b/backend/src/main/java/io/metersphere/service/GroupService.java index 8d36891aba..4c284866ca 100644 --- a/backend/src/main/java/io/metersphere/service/GroupService.java +++ b/backend/src/main/java/io/metersphere/service/GroupService.java @@ -1,11 +1,11 @@ package io.metersphere.service; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.GroupMapper; +import io.metersphere.base.mapper.UserGroupPermissionMapper; import io.metersphere.base.mapper.ext.ExtGroupMapper; import io.metersphere.base.mapper.ext.ExtUserGroupMapper; import io.metersphere.commons.constants.UserGroupType; @@ -16,8 +16,12 @@ import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.controller.request.group.EditGroupRequest; import io.metersphere.dto.*; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.session.ExecutorType; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -38,6 +42,10 @@ public class GroupService { private GroupMapper groupMapper; @Resource private ExtGroupMapper extGroupMapper; + @Resource + private SqlSessionFactory sqlSessionFactory; + @Resource + private UserGroupPermissionMapper userGroupPermissionMapper; public Pager> getGroupList(EditGroupRequest request) { SessionUser user = SessionUtils.getUser(); @@ -75,24 +83,29 @@ public class GroupService { public void deleteGroup(String id) { groupMapper.deleteByPrimaryKey(id); - // todo use_group 关系 + UserGroupPermissionExample example = new UserGroupPermissionExample(); + example.createCriteria().andGroupIdEqualTo(id); + userGroupPermissionMapper.deleteByExample(example); } - public GroupPermissionDTO getGroupResource() { + public GroupPermissionDTO getGroupResource(Group g) { GroupPermissionDTO dto = new GroupPermissionDTO(); InputStream permission = getClass().getResourceAsStream("/permission.json"); + String type = g.getType(); + String id = g.getId(); + UserGroupPermissionExample userGroupPermissionExample = new UserGroupPermissionExample(); + userGroupPermissionExample.createCriteria().andGroupIdEqualTo(id); + List userGroupPermissions = userGroupPermissionMapper.selectByExample(userGroupPermissionExample); + List permissionList = userGroupPermissions.stream().map(UserGroupPermission::getPermissionId).collect(Collectors.toList()); if (permission == null) { - throw new RuntimeException("读取文件失败"); + throw new RuntimeException("读取文件失败!"); } else { GroupJson group = null; try { group = JSON.parseObject(permission, GroupJson.class); List resource = group.getResource(); List permissions = group.getPermissions(); - dto.setSystem(getResourcePermission(resource, permissions, "SYSTEM")); - dto.setOrganization(getResourcePermission(resource, permissions, "ORGANIZATION")); - dto.setWorkspace(getResourcePermission(resource, permissions, "WORKSPACE")); - dto.setProject(getResourcePermission(resource, permissions, "PROJECT")); + getPermission(resource, permissions, type, dto, permissionList); } catch (IOException e) { e.printStackTrace(); } @@ -100,9 +113,48 @@ public class GroupService { return dto; } - private List getResourcePermission(List resource, List permissions, String type) { + public void editGroupPermission(EditGroupRequest request) { + List permissions = request.getPermissions(); + if (CollectionUtils.isEmpty(permissions)) { + return; + } + + UserGroupPermissionExample userGroupPermissionExample = new UserGroupPermissionExample(); + userGroupPermissionExample.createCriteria().andGroupIdEqualTo(request.getUserGroupId()); + userGroupPermissionMapper.deleteByExample(userGroupPermissionExample); + + SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); + UserGroupPermissionMapper mapper = sqlSession.getMapper(UserGroupPermissionMapper.class); + String groupId = request.getUserGroupId(); + permissions.forEach(permission -> { + if (BooleanUtils.isTrue(permission.getChecked())) { + String permissionId = permission.getId(); + String resourceId = permission.getResourceId(); + UserGroupPermission groupPermission = new UserGroupPermission(); + groupPermission.setId(UUID.randomUUID().toString()); + groupPermission.setGroupId(groupId); + groupPermission.setPermissionId(permissionId); + groupPermission.setModuleId(resourceId); + mapper.insert(groupPermission); + } + }); + sqlSession.flushStatements(); + } + + + + + + + + private List getResourcePermission(List resource, List permissions, String type, List permissionList) { List dto = new ArrayList<>(); List resources = resource.stream().filter(g -> g.getId().startsWith(type)).collect(Collectors.toList()); + permissions.forEach(p -> { + if (permissionList.contains(p.getId())) { + p.setChecked(true); + } + }); for (GroupResource r : resources) { GroupResourceDTO resourceDTO = new GroupResourceDTO(); resourceDTO.setResource(r); @@ -135,6 +187,34 @@ public class GroupService { return new Pager<>(); } + + private void getPermission(List resource, List permissions, String type, GroupPermissionDTO dto, List permissionList) { + dto.setSystem(getResourcePermission(resource, permissions, "SYSTEM", permissionList)); + dto.setOrganization(getResourcePermission(resource, permissions, "ORGANIZATION", permissionList)); + dto.setWorkspace(getResourcePermission(resource, permissions, "WORKSPACE", permissionList)); + dto.setProject(getResourcePermission(resource, permissions, "PROJECT", permissionList)); + switch (type) { + case "SYSTEM": + dto.setSystem(getResourcePermission(resource, permissions, "SYSTEM", permissionList)); + dto.setOrganization(getResourcePermission(resource, permissions, "ORGANIZATION", permissionList)); + dto.setWorkspace(getResourcePermission(resource, permissions, "WORKSPACE", permissionList)); + dto.setProject(getResourcePermission(resource, permissions, "PROJECT", permissionList)); + break; + case "ORGANIZATION": + dto.setOrganization(getResourcePermission(resource, permissions, "ORGANIZATION", permissionList)); + dto.setWorkspace(getResourcePermission(resource, permissions, "WORKSPACE", permissionList)); + dto.setProject(getResourcePermission(resource, permissions, "PROJECT", permissionList)); + break; + case "WORKSPACE": + dto.setWorkspace(getResourcePermission(resource, permissions, "WORKSPACE", permissionList)); + dto.setProject(getResourcePermission(resource, permissions, "PROJECT", permissionList)); + break; + case "PROJECT": + dto.setProject(getResourcePermission(resource, permissions, "PROJECT", permissionList)); + break; + default: + } + } private Pager> getUserGroup(String groupType, EditGroupRequest request) { diff --git a/backend/src/main/resources/permission.json b/backend/src/main/resources/permission.json index beb4b84aea..294611a4f1 100644 --- a/backend/src/main/resources/permission.json +++ b/backend/src/main/resources/permission.json @@ -1,730 +1,725 @@ { "permissions": [ - { - "id": "SYSTEM_USER:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "SYSTEM_USER" - }, +// { +// "id": "SYSTEM_USER:READ", +// "name": "用户", +// "resourceId": "SYSTEM_USER" +// }, { "id": "SYSTEM_USER:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建用户", "resourceId": "SYSTEM_USER" }, { "id": "SYSTEM_USER:READ+IMPORT", - "name": "$[{i18n_view_overview}]", + "name": "导入用户", "resourceId": "SYSTEM_USER" }, { "id": "SYSTEM_USER:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑用户", "resourceId": "SYSTEM_USER" }, { "id": "SYSTEM_USER:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除用户", "resourceId": "SYSTEM_USER" }, { "id": "SYSTEM_USER:READ+EDIT_PASSWORD", - "name": "$[{i18n_view_overview}]", + "name": "修改密码", "resourceId": "SYSTEM_USER" }, - { - "id": "SYSTEM_ORGANIZATION:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "SYSTEM_ORGANIZATION" - }, +// { +// "id": "SYSTEM_ORGANIZATION:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "SYSTEM_ORGANIZATION" +// }, { "id": "SYSTEM_ORGANIZATION:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建场景", "resourceId": "SYSTEM_ORGANIZATION" }, { "id": "SYSTEM_ORGANIZATION:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑场景", "resourceId": "SYSTEM_ORGANIZATION" }, { "id": "SYSTEM_ORGANIZATION:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除场景", "resourceId": "SYSTEM_ORGANIZATION" }, - { - "id": "SYSTEM_WORKSPACE:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "SYSTEM_WORKSPACE" - }, +// { +// "id": "SYSTEM_WORKSPACE:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "SYSTEM_WORKSPACE" +// }, { "id": "SYSTEM_WORKSPACE:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建工作空间", "resourceId": "SYSTEM_WORKSPACE" }, { "id": "SYSTEM_WORKSPACE:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑工作空间", "resourceId": "SYSTEM_WORKSPACE" }, { "id": "SYSTEM_WORKSPACE:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除工作空间", "resourceId": "SYSTEM_WORKSPACE" }, - { - "id": "SYSTEM_GROUP:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "SYSTEM_GROUP" - }, +// { +// "id": "SYSTEM_GROUP:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "SYSTEM_GROUP" +// }, { "id": "SYSTEM_GROUP:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建用户组", "resourceId": "SYSTEM_GROUP" }, { "id": "SYSTEM_GROUP:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑用户组", "resourceId": "SYSTEM_GROUP" }, { "id": "SYSTEM_GROUP:READ+SETTING_PERMISSION", - "name": "$[{i18n_view_overview}]", + "name": "设置权限", "resourceId": "SYSTEM_GROUP" }, { "id": "SYSTEM_GROUP:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除", "resourceId": "SYSTEM_GROUP" }, - { - "id": "SYSTEM_SETTING:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "SYSTEM_SETTING" - }, +// { +// "id": "SYSTEM_SETTING:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "SYSTEM_SETTING" +// }, { "id": "SYSTEM_SETTING:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑", "resourceId": "SYSTEM_SETTING" }, { "id": "SYSTEM_SETTING:READ+AUTH_MANAGE", - "name": "$[{i18n_view_overview}]", + "name": "授权管理", "resourceId": "SYSTEM_SETTING" }, - { - "id": "SYSTEM_QUOTA:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "SYSTEM_QUOTA" - }, +// { +// "id": "SYSTEM_QUOTA:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "SYSTEM_QUOTA" +// }, { "id": "SYSTEM_QUOTA:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑", "resourceId": "SYSTEM_QUOTA" }, - { - "id": "SYSTEM_AUTH:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "SYSTEM_AUTH" - }, +// { +// "id": "SYSTEM_AUTH:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "SYSTEM_AUTH" +// }, { "id": "SYSTEM_AUTH:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑", "resourceId": "SYSTEM_AUTH" }, - { - "id": "ORGANIZATION_USER:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "ORGANIZATION_USER" - }, +// { +// "id": "ORGANIZATION_USER:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "ORGANIZATION_USER" +// }, { "id": "ORGANIZATION_USER:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "添加成员", "resourceId": "ORGANIZATION_USER" }, { "id": "ORGANIZATION_USER:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑成员", "resourceId": "ORGANIZATION_USER" }, { "id": "ORGANIZATION_USER:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "移除成员", "resourceId": "ORGANIZATION_USER" }, - { - "id": "ORGANIZATION_WORKSPACE:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "ORGANIZATION_WORKSPACE" - }, +// { +// "id": "ORGANIZATION_WORKSPACE:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "ORGANIZATION_WORKSPACE" +// }, { "id": "ORGANIZATION_WORKSPACE:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建工作空间", "resourceId": "ORGANIZATION_WORKSPACE" }, { "id": "ORGANIZATION_WORKSPACE:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑工作空间", "resourceId": "ORGANIZATION_WORKSPACE" }, { "id": "ORGANIZATION_WORKSPACE:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除工作空间", "resourceId": "ORGANIZATION_WORKSPACE" }, - { - "id": "ORGANIZATION_GROUP:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "ORGANIZATION_GROUP" - }, +// { +// "id": "ORGANIZATION_GROUP:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "ORGANIZATION_GROUP" +// }, { "id": "ORGANIZATION_GROUP:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建", "resourceId": "ORGANIZATION_GROUP" }, { "id": "ORGANIZATION_GROUP:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑", "resourceId": "ORGANIZATION_GROUP" }, { "id": "ORGANIZATION_GROUP:READ+SETTING_PERMISSION", - "name": "$[{i18n_view_overview}]", + "name": "设置权限", "resourceId": "ORGANIZATION_GROUP" }, { "id": "ORGANIZATION_GROUP:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除", "resourceId": "ORGANIZATION_GROUP" }, - { - "id": "ORGANIZATION_SERVICE:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "ORGANIZATION_SERVICE" - }, +// { +// "id": "ORGANIZATION_SERVICE:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "ORGANIZATION_SERVICE" +// }, { "id": "ORGANIZATION_SERVICE:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑", "resourceId": "ORGANIZATION_SERVICE" }, - { - "id": "ORGANIZATION_MESSAGE:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "ORGANIZATION_MESSAGE" - }, +// { +// "id": "ORGANIZATION_MESSAGE:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "ORGANIZATION_MESSAGE" +// }, { "id": "ORGANIZATION_MESSAGE:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑", "resourceId": "ORGANIZATION_MESSAGE" }, - { - "id": "WORKSPACE_USER:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "WORKSPACE_USER" - }, +// { +// "id": "WORKSPACE_USER:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "WORKSPACE_USER" +// }, { "id": "WORKSPACE_USER:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "添加成员", "resourceId": "WORKSPACE_USER" }, { "id": "WORKSPACE_USER:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑成员", "resourceId": "WORKSPACE_USER" }, { "id": "WORKSPACE_USER:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除成员", "resourceId": "WORKSPACE_USER" }, - { - "id": "WORKSPACE_TEMPLATE:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "WORKSPACE_TEMPLATE" - }, - { - "id": "WORKSPACE_TEMPLATE:READ+CUSTOM", - "name": "$[{i18n_view_overview}]", - "resourceId": "WORKSPACE_TEMPLATE" - }, +// { +// "id": "WORKSPACE_TEMPLATE:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "WORKSPACE_TEMPLATE" +// }, { "id": "WORKSPACE_TEMPLATE:READ+CASE_TEMPLATE", - "name": "$[{i18n_view_overview}]", + "name": "用例模版", "resourceId": "WORKSPACE_TEMPLATE" }, { "id": "WORKSPACE_TEMPLATE:READ+ISSUE_TEMPLATE", - "name": "$[{i18n_view_overview}]", + "name": "缺陷模版", + "resourceId": "WORKSPACE_TEMPLATE" + }, + { + "id": "WORKSPACE_TEMPLATE:READ+CUSTOM", + "name": "自定义字段", "resourceId": "WORKSPACE_TEMPLATE" }, { "id": "WORKSPACE_TEMPLATE:READ+REPORT_TEMPLATE", - "name": "$[{i18n_view_overview}]", + "name": "测试报告模版", "resourceId": "WORKSPACE_TEMPLATE" }, - { - "id": "PROJECT_USER:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_USER" - }, +// { +// "id": "PROJECT_USER:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_USER" +// }, { "id": "PROJECT_USER:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "添加成员", "resourceId": "PROJECT_USER" }, { "id": "PROJECT_USER:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑成员", "resourceId": "PROJECT_USER" }, { "id": "PROJECT_USER:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "移除成员", "resourceId": "PROJECT_USER" }, - { - "id": "PROJECT_MANAGER:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_MANAGER" - }, +// { +// "id": "PROJECT_MANAGER:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_MANAGER" +// }, { "id": "PROJECT_MANAGER:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建项目", "resourceId": "PROJECT_MANAGER" }, { "id": "PROJECT_MANAGER:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑项目", "resourceId": "PROJECT_MANAGER" }, { "id": "PROJECT_MANAGER:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除项目", "resourceId": "PROJECT_MANAGER" }, - { - "id": "PROJECT_ENVIRONMENT:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_ENVIRONMENT" - }, +// { +// "id": "PROJECT_ENVIRONMENT:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_ENVIRONMENT" +// }, { "id": "PROJECT_ENVIRONMENT:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建环境", "resourceId": "PROJECT_ENVIRONMENT" }, { "id": "PROJECT_ENVIRONMENT:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑环境", "resourceId": "PROJECT_ENVIRONMENT" }, { "id": "PROJECT_ENVIRONMENT:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除环境", "resourceId": "PROJECT_ENVIRONMENT" }, { "id": "PROJECT_ENVIRONMENT:READ+COPY", - "name": "$[{i18n_view_overview}]", + "name": "复制环境", "resourceId": "PROJECT_ENVIRONMENT" }, { "id": "PROJECT_ENVIRONMENT:READ+IMPORT", - "name": "$[{i18n_view_overview}]", + "name": "导入环境", "resourceId": "PROJECT_ENVIRONMENT" }, { "id": "PROJECT_ENVIRONMENT:READ+EXPORT", - "name": "$[{i18n_view_overview}]", + "name": "导出环境", "resourceId": "PROJECT_ENVIRONMENT" }, - { - "id": "PROJECT_TRACK_CASE:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_TRACK_CASE" - }, +// { +// "id": "PROJECT_TRACK_CASE:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_TRACK_CASE" +// }, { "id": "PROJECT_TRACK_CASE:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建用例", "resourceId": "PROJECT_TRACK_CASE" }, { "id": "PROJECT_TRACK_CASE:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑用例", "resourceId": "PROJECT_TRACK_CASE" }, { "id": "PROJECT_TRACK_CASE:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除用例", "resourceId": "PROJECT_TRACK_CASE" }, { "id": "PROJECT_TRACK_CASE:READ+COPY", - "name": "$[{i18n_view_overview}]", + "name": "复制用例", "resourceId": "PROJECT_TRACK_CASE" }, { "id": "PROJECT_TRACK_CASE:READ+IMPORT", - "name": "$[{i18n_view_overview}]", + "name": "导入用例", "resourceId": "PROJECT_TRACK_CASE" }, { "id": "PROJECT_TRACK_CASE:READ+EXPORT", - "name": "$[{i18n_view_overview}]", + "name": "导出用例", "resourceId": "PROJECT_TRACK_CASE" }, - { - "id": "PROJECT_TRACK_REVIEW:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_TRACK_REVIEW" - }, +// { +// "id": "PROJECT_TRACK_REVIEW:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_TRACK_REVIEW" +// }, { "id": "PROJECT_TRACK_REVIEW:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建评审", "resourceId": "PROJECT_TRACK_REVIEW" }, { "id": "PROJECT_TRACK_REVIEW:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑评审", "resourceId": "PROJECT_TRACK_REVIEW" }, { "id": "PROJECT_TRACK_REVIEW:READ+DELETE", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_TRACK_REVIEW" - }, - { - "id": "PROJECT_TRACK_REVIEW:READ+RELEVANCE_OR_CANCEL", - "name": "$[{i18n_view_overview}]", + "name": "删除评审", "resourceId": "PROJECT_TRACK_REVIEW" }, { "id": "PROJECT_TRACK_REVIEW:READ+REVIEW", - "name": "$[{i18n_view_overview}]", + "name": "开始评审", "resourceId": "PROJECT_TRACK_REVIEW" }, { "id": "PROJECT_TRACK_REVIEW:READ+COMMENT", - "name": "$[{i18n_view_overview}]", + "name": "发表评论", "resourceId": "PROJECT_TRACK_REVIEW" }, { - "id": "PROJECT_TRACK_PLAN:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_TRACK_PLAN" + "id": "PROJECT_TRACK_REVIEW:READ+RELEVANCE_OR_CANCEL", + "name": "关联/取消关联用例", + "resourceId": "PROJECT_TRACK_REVIEW" }, +// { +// "id": "PROJECT_TRACK_PLAN:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_TRACK_PLAN" +// }, { "id": "PROJECT_TRACK_PLAN:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建测试计划", "resourceId": "PROJECT_TRACK_PLAN" }, { "id": "PROJECT_TRACK_PLAN:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑测试计划", "resourceId": "PROJECT_TRACK_PLAN" }, { "id": "PROJECT_TRACK_PLAN:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除测试计划", "resourceId": "PROJECT_TRACK_PLAN" }, { "id": "PROJECT_TRACK_PLAN:READ+SCHEDULE", - "name": "$[{i18n_view_overview}]", + "name": "定时任务", "resourceId": "PROJECT_TRACK_PLAN" }, { "id": "PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL", - "name": "$[{i18n_view_overview}]", + "name": "关联/取消关联用例", "resourceId": "PROJECT_TRACK_PLAN" }, - { - "id": "PROJECT_API_DEFINITION:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_DEFINITION" - }, +// { +// "id": "PROJECT_API_DEFINITION:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_API_DEFINITION" +// }, { "id": "PROJECT_API_DEFINITION:READ+CREATE_API", - "name": "$[{i18n_view_overview}]", + "name": "创建接口", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+EDIT_API", - "name": "$[{i18n_view_overview}]", + "name": "编辑接口", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+DELETE_API", - "name": "$[{i18n_view_overview}]", + "name": "删除接口", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+CREATE_CASE", - "name": "$[{i18n_view_overview}]", + "name": "添加用例", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+EDIT_CASE", - "name": "$[{i18n_view_overview}]", + "name": "编辑用例", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+DELETE_CASE", - "name": "$[{i18n_view_overview}]", + "name": "删除用例", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+COPY_CASE", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_DEFINITION" - }, - { - "id": "PROJECT_API_DEFINITION:READ+CREATE_PERFORMANCE", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_DEFINITION" - }, - { - "id": "PROJECT_API_DEFINITION:READ+CREATE_PERFORMANCE", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_DEFINITION" - }, - { - "id": "PROJECT_API_DEFINITION:READ+RUN", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_DEFINITION" - }, - { - "id": "PROJECT_API_DEFINITION:READ+DEBUG", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_DEFINITION" - }, - { - "id": "PROJECT_API_DEFINITION:READ+MOCK", - "name": "$[{i18n_view_overview}]", + "name": "复制用例", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+IMPORT_API", - "name": "$[{i18n_view_overview}]", + "name": "导入接口", "resourceId": "PROJECT_API_DEFINITION" }, { "id": "PROJECT_API_DEFINITION:READ+EXPORT_API", - "name": "$[{i18n_view_overview}]", + "name": "导出接口", "resourceId": "PROJECT_API_DEFINITION" }, { - "id": "PROJECT_API_SCENARIO:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_SCENARIO" + "id": "PROJECT_API_DEFINITION:READ+CREATE_PERFORMANCE", + "name": "创建性能测试", + "resourceId": "PROJECT_API_DEFINITION" }, + { + "id": "PROJECT_API_DEFINITION:READ+RUN", + "name": "执行", + "resourceId": "PROJECT_API_DEFINITION" + }, + { + "id": "PROJECT_API_DEFINITION:READ+DEBUG", + "name": "调试", + "resourceId": "PROJECT_API_DEFINITION" + }, + { + "id": "PROJECT_API_DEFINITION:READ+MOCK", + "name": "MOCK设置", + "resourceId": "PROJECT_API_DEFINITION" + }, +// { +// "id": "PROJECT_API_SCENARIO:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_API_SCENARIO" +// }, { "id": "PROJECT_API_SCENARIO:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+COPY", - "name": "$[{i18n_view_overview}]", + "name": "复制场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+RUN", - "name": "$[{i18n_view_overview}]", + "name": "执行场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+DEBUG", - "name": "$[{i18n_view_overview}]", + "name": "调试场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+SCHEDULE", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_SCENARIO" - }, - { - "id": "PROJECT_API_SCENARIO:READ+CREATE_PERFORMANCE", - "name": "$[{i18n_view_overview}]", + "name": "定时任务", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+IMPORT_SCENARIO", - "name": "$[{i18n_view_overview}]", + "name": "导入场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+EXPORT_SCENARIO", - "name": "$[{i18n_view_overview}]", + "name": "导出场景", "resourceId": "PROJECT_API_SCENARIO" }, { "id": "PROJECT_API_SCENARIO:READ+MOVE_BATCH", - "name": "$[{i18n_view_overview}]", + "name": "批量移动", "resourceId": "PROJECT_API_SCENARIO" }, { - "id": "PROJECT_API_REPORT:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_API_REPORT" + "id": "PROJECT_API_SCENARIO:READ+CREATE_PERFORMANCE", + "name": "创建性能测试", + "resourceId": "PROJECT_API_SCENARIO" }, +// { +// "id": "PROJECT_API_REPORT:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_API_REPORT" +// }, { "id": "PROJECT_API_REPORT:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除报告", "resourceId": "PROJECT_API_REPORT" }, - { - "id": "PROJECT_PERFORMANCE_TEST:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_PERFORMANCE_TEST" - }, +// { +// "id": "PROJECT_PERFORMANCE_TEST:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_PERFORMANCE_TEST" +// }, { "id": "PROJECT_PERFORMANCE_TEST:READ+CREATE", - "name": "$[{i18n_view_overview}]", + "name": "创建测试", "resourceId": "PROJECT_PERFORMANCE_TEST" }, { "id": "PROJECT_PERFORMANCE_TEST:READ+EDIT", - "name": "$[{i18n_view_overview}]", + "name": "编辑测试", "resourceId": "PROJECT_PERFORMANCE_TEST" }, { "id": "PROJECT_PERFORMANCE_TEST:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除测试", "resourceId": "PROJECT_PERFORMANCE_TEST" }, { "id": "PROJECT_PERFORMANCE_TEST:READ+COPY", - "name": "$[{i18n_view_overview}]", + "name": "复制测试", "resourceId": "PROJECT_PERFORMANCE_TEST" }, { "id": "PROJECT_PERFORMANCE_TEST:READ+RUN", - "name": "$[{i18n_view_overview}]", + "name": "运行", "resourceId": "PROJECT_PERFORMANCE_TEST" }, { "id": "PROJECT_PERFORMANCE_TEST:READ+SCHEDULE", - "name": "$[{i18n_view_overview}]", + "name": "定时任务", "resourceId": "PROJECT_PERFORMANCE_TEST" }, - { - "id": "PROJECT_PERFORMANCE_REPORT:READ", - "name": "$[{i18n_view_overview}]", - "resourceId": "PROJECT_PERFORMANCE_REPORT" - }, +// { +// "id": "PROJECT_PERFORMANCE_REPORT:READ", +// "name": "$[{i18n_view_overview}]", +// "resourceId": "PROJECT_PERFORMANCE_REPORT" +// }, { "id": "PROJECT_PERFORMANCE_REPORT:READ+DELETE", - "name": "$[{i18n_view_overview}]", + "name": "删除报告", "resourceId": "PROJECT_PERFORMANCE_REPORT" } ], "resource": [ { "id": "SYSTEM_USER", - "name": "用户" + "name": "系统/用户" }, { "id": "SYSTEM_ORGANIZATION", - "name": "组织" + "name": "系统/组织" }, { "id": "SYSTEM_WORKSPACE", - "name": "工作空间" + "name": "系统/工作空间" }, { "id": "SYSTEM_GROUP", - "name": "用户组与权限" + "name": "系统/用户组与权限" }, { "id": "SYSTEM_SETTING", - "name": "系统参数设置" + "name": "系统/系统参数设置" }, { "id": "SYSTEM_QUOTA", - "name": "配额管理" + "name": "系统/配额管理" }, { "id": "SYSTEM_AUTH", - "name": "授权管理" + "name": "系统/授权管理" }, { "id": "ORGANIZATION_USER", - "name": "成员" + "name": "组织/成员" }, { "id": "ORGANIZATION_WORKSPACE", - "name": "工作空间" + "name": "组织/工作空间" }, { "id": "ORGANIZATION_GROUP", - "name": "用户组与权限" + "name": "组织/用户组与权限" }, { "id": "ORGANIZATION_SERVICE", - "name": "服务集成" + "name": "组织/服务集成" }, { "id": "ORGANIZATION_MESSAGE", - "name": "消息设置" + "name": "组织/消息设置" }, { "id": "WORKSPACE_USER", - "name": "成员" + "name": "工作空间/成员" }, { "id": "WORKSPACE_TEMPLATE", - "name": "模版设置" + "name": "工作空间/模版设置" }, { "id": "PROJECT_USER", - "name": "成员" + "name": "项目/成员" }, { "id": "PROJECT_MANAGER", - "name": "项目管理" + "name": "项目/项目管理" }, { "id": "PROJECT_ENVIRONMENT", - "name": "环境设置" + "name": "项目/环境设置" }, { "id": "PROJECT_TRACK_CASE", - "name": "测试用例" + "name": "项目/测试用例" }, { "id": "PROJECT_TRACK_REVIEW", - "name": "测试评审" + "name": "项目/测试评审" }, { "id": "PROJECT_TRACK_PLAN", - "name": "测试计划" + "name": "项目/测试计划" }, { "id": "PROJECT_API_DEFINITION", - "name": "接口定义" + "name": "项目/接口定义" }, { "id": "PROJECT_API_SCENARIO", - "name": "接口自动化" + "name": "项目/接口自动化" }, { "id": "PROJECT_API_REPORT", - "name": "测试报告" + "name": "项目/测试报告" }, { "id": "PROJECT_PERFORMANCE_TEST", - "name": "测试" + "name": "项目/测试" }, { "id": "PROJECT_PERFORMANCE_REPORT", - "name": "报告" + "name": "项目/报告" } ] } \ No newline at end of file diff --git a/frontend/src/business/components/settings/system/group/EditPermission.vue b/frontend/src/business/components/settings/system/group/EditPermission.vue index 8ee2a9fa35..9e516124c8 100644 --- a/frontend/src/business/components/settings/system/group/EditPermission.vue +++ b/frontend/src/business/components/settings/system/group/EditPermission.vue @@ -1,74 +1,111 @@ diff --git a/frontend/src/business/components/settings/system/group/UserGroup.vue b/frontend/src/business/components/settings/system/group/UserGroup.vue index c474d0517b..b4080444c3 100644 --- a/frontend/src/business/components/settings/system/group/UserGroup.vue +++ b/frontend/src/business/components/settings/system/group/UserGroup.vue @@ -29,8 +29,8 @@