From 16e0e805f85aee41f4622b9709b0d71b2327fcd5 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 26 May 2021 19:03:16 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E6=89=B9=E9=87=8F=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V85__v1.10_permission_refactor.sql | 13 +++++++++++++ backend/src/main/resources/permission.json | 15 +++++++++++++++ .../track/case/components/ShowMoreBtn.vue | 2 +- .../view/comonents/api/TestPlanApiCaseList.vue | 6 +++--- .../comonents/api/TestPlanApiScenarioList.vue | 8 +++++--- .../functional/FunctionalTestCaseList.vue | 4 ++-- .../view/comonents/load/TestPlanLoadCaseList.vue | 4 ++-- 7 files changed, 41 insertions(+), 11 deletions(-) diff --git a/backend/src/main/resources/db/migration/V85__v1.10_permission_refactor.sql b/backend/src/main/resources/db/migration/V85__v1.10_permission_refactor.sql index e04404050b..225f8a8d66 100644 --- a/backend/src/main/resources/db/migration/V85__v1.10_permission_refactor.sql +++ b/backend/src/main/resources/db/migration/V85__v1.10_permission_refactor.sql @@ -406,6 +406,13 @@ INSERT INTO user_group_permission (id, group_id, permission_id, module_id) VALUES (uuid(), 'project_admin', 'PROJECT_ENVIRONMENT:READ', 'PROJECT_ENVIRONMENT'); INSERT INTO user_group_permission (id, group_id, permission_id, module_id) VALUES (uuid(), 'project_admin', 'PROJECT_TRACK_CASE:READ+COPY', 'PROJECT_TRACK_CASE'); +insert into user_group_permission (id, group_id, permission_id, module_id) +values (uuid(), 'project_admin', 'PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT', 'PROJECT_TRACK_PLAN'); +insert into user_group_permission (id, group_id, permission_id, module_id) +values (uuid(), 'project_admin', 'PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN', 'PROJECT_TRACK_PLAN'); +insert into metersphere_dev.user_group_permission (id, group_id, permission_id, module_id) +values (uuid(), 'project_admin', 'PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE','PROJECT_TRACK_PLAN'); + -- 项目成员 INSERT INTO user_group_permission (id, group_id, permission_id, module_id) @@ -540,6 +547,12 @@ INSERT INTO user_group_permission (id, group_id, permission_id, module_id) VALUES (uuid(), 'project_member', 'PROJECT_API_SCENARIO:READ+RUN', 'PROJECT_API_SCENARIO'); INSERT INTO user_group_permission (id, group_id, permission_id, module_id) VALUES (uuid(), 'project_member', 'PROJECT_TRACK_PLAN:READ', 'PROJECT_TRACK_PLAN'); +insert into user_group_permission (id, group_id, permission_id, module_id) +values (uuid(), 'project_member', 'PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT', 'PROJECT_TRACK_PLAN'); +insert into user_group_permission (id, group_id, permission_id, module_id) +values (uuid(), 'project_member', 'PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN', 'PROJECT_TRACK_PLAN'); +insert into metersphere_dev.user_group_permission (id, group_id, permission_id, module_id) +values (uuid(), 'project_member', 'PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE','PROJECT_TRACK_PLAN'); -- 只读用户 INSERT INTO user_group_permission (id, group_id, permission_id, module_id) diff --git a/backend/src/main/resources/permission.json b/backend/src/main/resources/permission.json index b498cef2f3..72b465e41f 100644 --- a/backend/src/main/resources/permission.json +++ b/backend/src/main/resources/permission.json @@ -514,6 +514,21 @@ "name": "关联/取消关联用例", "resourceId": "PROJECT_TRACK_PLAN" }, + { + "id": "PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE", + "name": "批量取消关联用例", + "resourceId": "PROJECT_TRACK_PLAN" + }, + { + "id": "PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN", + "name": "批量执行用例", + "resourceId": "PROJECT_TRACK_PLAN" + }, + { + "id": "PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT", + "name": "批量编辑用例", + "resourceId": "PROJECT_TRACK_PLAN" + }, { "id": "PROJECT_API_DEFINITION:READ", "name": "查询接口", diff --git a/frontend/src/business/components/track/case/components/ShowMoreBtn.vue b/frontend/src/business/components/track/case/components/ShowMoreBtn.vue index 6bd401c7a3..67db28a734 100644 --- a/frontend/src/business/components/track/case/components/ShowMoreBtn.vue +++ b/frontend/src/business/components/track/case/components/ShowMoreBtn.vue @@ -6,7 +6,7 @@
{{$t('test_track.case.batch_handle', [size])}}
- + {{btn.name}}
diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue index 14f1e5ae27..44b1cdd1cb 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue @@ -230,9 +230,9 @@ export default { deletePath: "/test/case/delete", selectRows: new Set(), buttons: [ - {name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch}, - {name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute}, - {name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit} + {name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']}, + {name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']}, + {name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']} ], typeArr: [ {id: 'projectEnv', name: this.$t('api_test.definition.request.run_env')}, diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue index 85c33c2f87..62f44e1be4 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue @@ -205,12 +205,14 @@ export default { ...API_SCENARIO_FILTERS, buttons: [ { - name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch + name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] }, { - name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute + name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'] }, - {name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit} + { + name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT'] + } ], selectRows: new Set(), typeArr: [ diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue index be2cdebb86..d0b995bf7a 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -360,10 +360,10 @@ export default { showMore: false, buttons: [ { - name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit + name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT'] }, { - name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch + name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] } ], typeArr: [ diff --git a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue index 4627ed87d8..19e99a193e 100644 --- a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue @@ -199,10 +199,10 @@ export default { screenHeight: 'calc(100vh - 330px)',//屏幕高度 buttons: [ { - name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch + name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] }, { - name: this.$t('test_track.plan.load_case.batch_exec_cases'), handleClick: this.handleRunBatch + name: this.$t('test_track.plan.load_case.batch_exec_cases'), handleClick: this.handleRunBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'] } ], statusFilters: [