From ce8e4c21754ac1e0784f5610ef3140b17ca78925 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 26 Jun 2024 10:48:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=A1=E9=AA=8C=E8=B5=84=E6=BA=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8A=A5=E9=94=99=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/system/mapper/ExtCheckOwnerMapper.xml | 4 ++-- .../plan/controller/TestPlanApiCaseController.java | 4 ++-- .../plan/controller/TestPlanApiScenarioController.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtCheckOwnerMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtCheckOwnerMapper.xml index 542f26b30b..8073a44475 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtCheckOwnerMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtCheckOwnerMapper.xml @@ -18,8 +18,8 @@ FROM user_role_relation WHERE source_id IN (SELECT project_id FROM ${table} JOIN ${relationTable} ON ${table}.id = ${relationTable}.${table}_id - JOIN project ON ${table}.project_id = project.id AND project.enable = TRUE - WHERE ${table}.id IN + JOIN project ON ${table}.project_id = project.id AND project.enable = TRUE + WHERE ${relationTable}.id IN #{id} ) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java index 6ef928383a..99bf62b8eb 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiCaseController.java @@ -126,7 +126,7 @@ public class TestPlanApiCaseController { @GetMapping("/run/{id}") @Operation(summary = "用例执行") @RequiresPermissions(PermissionConstants.TEST_PLAN_READ_EXECUTE) - @CheckOwner(resourceId = "#id", resourceType = "test_plan_api_case", relationType = "test_plan") + @CheckOwner(resourceId = "#id", resourceType = "test_plan", relationType = "test_plan_api_case") public TaskRequestDTO run(@PathVariable String id, @Schema(description = "报告ID,传了可以实时获取结果,不传则不支持实时获取") @RequestParam(required = false) String reportId) { @@ -137,7 +137,7 @@ public class TestPlanApiCaseController { @PostMapping("/batch/run") @Operation(summary = "批量执行") @RequiresPermissions(PermissionConstants.TEST_PLAN_READ_EXECUTE) - @CheckOwner(resourceId = "#request.getSelectIds()", resourceType = "test_plan_api_case", relationType = "test_plan") + @CheckOwner(resourceId = "#request.getSelectIds()", resourceType = "test_plan", relationType = "test_plan_api_case") public void batchRun(@Validated @RequestBody TestPlanApiCaseBatchRunRequest request) { testPlanApiCaseBatchRunService.asyncBatchRun(request, SessionUtils.getUserId()); } diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java index 42a860e0ac..7a1e53a37f 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/controller/TestPlanApiScenarioController.java @@ -79,7 +79,7 @@ public class TestPlanApiScenarioController { @GetMapping("/run/{id}") @Operation(summary = "接口测试-接口场景管理-场景执行") @RequiresPermissions(PermissionConstants.TEST_PLAN_READ_EXECUTE) - @CheckOwner(resourceId = "#id", resourceType = "test_plan_api_scenario", relationType = "test_plan") + @CheckOwner(resourceId = "#id", resourceType = "test_plan", relationType = "test_plan_api_scenario") public TaskRequestDTO run(@PathVariable String id, @RequestParam(required = false) String reportId) { return testPlanApiScenarioService.run(id, reportId, SessionUtils.getUserId()); } @@ -87,7 +87,7 @@ public class TestPlanApiScenarioController { @PostMapping("/batch/run") @Operation(summary = "批量执行") @RequiresPermissions(PermissionConstants.TEST_PLAN_READ_EXECUTE) - @CheckOwner(resourceId = "#request.getSelectIds()", resourceType = "test_plan_api_scenario", relationType = "test_plan") + @CheckOwner(resourceId = "#request.getSelectIds()", resourceType = "test_plan", relationType = "test_plan_api_scenario") public void batchRun(@Validated @RequestBody TestPlanApiScenarioBatchRunRequest request) { testPlanApiScenarioBatchRunService.asyncBatchRun(request, SessionUtils.getUserId()); }