From 427bfa6a4a58eb553f4b53bf5c804b89c9244d6a Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 15 Nov 2021 18:03:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=5F=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE-?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E5=91=98=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BB=84=E5=A4=B1=E8=B4=A5=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA403=5FForbidden=20=20--bug=3D1007930=20--user=3D?= =?UTF-8?q?=E7=8E=8B=E5=AD=9D=E5=88=9A=20=E3=80=90=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E3=80=91-=E9=A1=B9=E7=9B=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E7=BB=84?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=8C=E6=8F=90=E7=A4=BA403=20Forbidden=20?= =?UTF-8?q?https://www.tapd.cn/55049933/s/1067623?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/PermissionConstants.java | 1 + .../controller/GroupController.java | 8 ++++---- .../components/search/search-components.js | 19 ++++++++++++++++++- .../components/project/menu/EditUserGroup.vue | 19 +++---------------- frontend/src/i18n/en-US.js | 3 ++- frontend/src/i18n/zh-CN.js | 3 ++- frontend/src/i18n/zh-TW.js | 3 ++- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java b/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java index 924f8f03f9..6050569a44 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java +++ b/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java @@ -84,6 +84,7 @@ public class PermissionConstants { public static final String PROJECT_GROUP_READ_CREATE = "PROJECT_GROUP:READ+CREATE"; public static final String PROJECT_GROUP_READ_EDIT = "PROJECT_GROUP:READ+EDIT"; public static final String PROJECT_GROUP_READ_DELETE = "PROJECT_GROUP:READ+DELETE"; + public static final String PROJECT_GROUP_READ_SETTING_PERMISSION = "PROJECT_GROUP:READ+SETTING_PERMISSION"; public static final String PROJECT_ENVIRONMENT_READ = "PROJECT_ENVIRONMENT:READ"; public static final String PROJECT_ENVIRONMENT_READ_CREATE = "PROJECT_ENVIRONMENT:READ+CREATE"; diff --git a/backend/src/main/java/io/metersphere/controller/GroupController.java b/backend/src/main/java/io/metersphere/controller/GroupController.java index 36d3d3ade7..ab83a00d91 100644 --- a/backend/src/main/java/io/metersphere/controller/GroupController.java +++ b/backend/src/main/java/io/metersphere/controller/GroupController.java @@ -53,7 +53,7 @@ public class GroupController { } @PostMapping("/add") - @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_CREATE}, logical = Logical.OR) + @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_CREATE , PermissionConstants.PROJECT_GROUP_READ_CREATE}, logical = Logical.OR) @MsAuditLog(module = "group_permission", type = OperLogConstants.CREATE, content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class) public Group addGroup(@RequestBody EditGroupRequest request) { request.setId(UUID.randomUUID().toString()); @@ -61,14 +61,14 @@ public class GroupController { } @PostMapping("/edit") - @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_EDIT}, logical = Logical.OR) + @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_EDIT , PermissionConstants.PROJECT_GROUP_READ_EDIT}, logical = Logical.OR) @MsAuditLog(module = "group_permission", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#request.id)", content = "#msClass.getLogDetails(#request.id)", msClass = GroupService.class) public void editGroup(@RequestBody EditGroupRequest request) { groupService.editGroup(request); } @GetMapping("/delete/{id}") - @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_DELETE}, logical = Logical.OR) + @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_DELETE , PermissionConstants.PROJECT_GROUP_READ_DELETE}, logical = Logical.OR) @MsAuditLog(module = "group_permission", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = GroupService.class) public void deleteGroup(@PathVariable String id) { groupService.deleteGroup(id); @@ -80,7 +80,7 @@ public class GroupController { } @PostMapping("/permission/edit") - @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_SETTING_PERMISSION}, logical = Logical.OR) + @RequiresPermissions(value={PermissionConstants.SYSTEM_GROUP_READ_SETTING_PERMISSION , PermissionConstants.PROJECT_GROUP_READ_SETTING_PERMISSION}, logical = Logical.OR) public void editGroupPermission(@RequestBody EditGroupRequest editGroupRequest) { groupService.editGroupPermission(editGroupRequest); } diff --git a/frontend/src/business/components/common/components/search/search-components.js b/frontend/src/business/components/common/components/search/search-components.js index 0179e0a21e..0e25aa8662 100644 --- a/frontend/src/business/components/common/components/search/search-components.js +++ b/frontend/src/business/components/common/components/search/search-components.js @@ -447,6 +447,23 @@ export const TEST_PLAN_STATUS = { } }; +export const TEST_PLAN_REPORT_STATUS = { + key: "status", + name: 'MsTableSearchSelect', + label: "test_track.plan.plan_status", + operator: { + options: [OPERATORS.IN, OPERATORS.NOT_IN] + }, + options: [ + {label: 'Starting', value: 'Starting'}, + {label: 'Running', value: 'Underway'}, + {label: 'Completed', value: 'Completed'} + ], + props: { + multiple: true + } +}; + export const TEST_PLAN_TRIGGER_MODE = { key: "triggerMode", name: 'MsTableSearchSelect', @@ -496,7 +513,7 @@ export const API_CASE_CONFIGS = [NAME, API_CASE_PRIORITY, API_TAGS, API_CASE_RES export const API_SCENARIO_CONFIGS = [NAME, API_CASE_PRIORITY, API_TAGS, API_SCENARIO_RESULT, UPDATE_TIME, CREATE_TIME, CREATOR]; -export const TEST_PLAN_REPORT_CONFIGS = [NAME, TEST_PLAN_NAME,CREATOR, CREATE_TIME, TEST_PLAN_TRIGGER_MODE, TEST_PLAN_STATUS]; +export const TEST_PLAN_REPORT_CONFIGS = [NAME, TEST_PLAN_NAME,CREATOR, CREATE_TIME, TEST_PLAN_TRIGGER_MODE, TEST_PLAN_REPORT_STATUS]; // 测试计划 功能用例 export const TEST_PLAN_TEST_CASE_CONFIGS = [NAME, API_TAGS, MODULE, PRIORITY, CREATE_TIME, UPDATE_TIME, EXECUTOR, CASE_REVIEW_STATUS]; diff --git a/frontend/src/business/components/project/menu/EditUserGroup.vue b/frontend/src/business/components/project/menu/EditUserGroup.vue index aa41d611e3..c6a4e569f3 100644 --- a/frontend/src/business/components/project/menu/EditUserGroup.vue +++ b/frontend/src/business/components/project/menu/EditUserGroup.vue @@ -12,7 +12,7 @@ + disabled> @@ -24,7 +24,7 @@ - @@ -97,10 +97,6 @@ export default { this.edit(); } - if (this.dialogType === 'copy') { - return; - } - }, create() { this.$refs['form'].validate(valid => { @@ -135,15 +131,6 @@ export default { this.dialogVisible = true; this.dialogType = type; this.form = Object.assign({type: 'PROJECT' ,global: false , scopeId: getCurrentWorkspaceId()}, row); - if (type !== 'create') { - if (this.form.type === GROUP_SYSTEM) { - this.form.global = true; - this.show = false; - } else { - this.form.global = true; - this.show = !this.form.global; - } - } this.getWorkspace(); }, cancel() { @@ -163,7 +150,7 @@ export default { this.show = this.isSystem ? false : !global; } else { this.form.global = false; - this.$warning(this.$t('group.group_global_warning')) + this.$warning(this.$t('group.ws_admin_global')) } }) }, diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 9231d35f8b..f5c4f890ec 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -692,7 +692,8 @@ export default { check_all: 'ALL', permission: 'Permission', please_select_group: 'Please Select Group', - global: 'Global' + global: 'Global', + ws_admin_global: 'Only workspace administrators can create global user groups' }, role: { please_choose_role: 'Please Choose Role', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 5f534d78a5..f71f393b15 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -697,7 +697,8 @@ export default { check_all: '全选', permission: '权限', please_select_group: '请选择用户组', - global: '全局' + global: '全局', + ws_admin_global: '工作空间管理员才可以创建全局用户组' }, role: { please_choose_role: '请选择角色', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 173946e844..f063b82ab1 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -696,7 +696,8 @@ export default { check_all: '全選', permission: '權限', please_select_group: '請選擇用戶組', - global: '全局' + global: '全局', + ws_admin_global: '工作空間管理員才可以創建全域用戶組' }, role: { please_choose_role: '請選擇角色',