From 32bdfe2c530141a5361d0b842f694387b170a151 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 27 Jun 2024 14:19:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DcheckOwner=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/service/scenario/ApiScenarioService.java | 8 ++++++++ .../metersphere/controller/TestPlanReportController.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java index 4327714548..d5f3d0f277 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java @@ -2201,6 +2201,14 @@ public class ApiScenarioService { if (scenario == null) { return; } + long count = SessionUtils.getUser().getGroups() + .stream() + .filter(g -> StringUtils.equals(userId, UserGroupConstants.SUPER_GROUP)) + .count(); + + if (count > 0) { + return; + } if (!extCheckOwnerMapper.checkoutOwner("api_scenario", userId, List.of(scenarioId))) { MSException.throwException(Translator.get("check_owner_case")); } diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanReportController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanReportController.java index f0f2c0d9bf..03379648db 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanReportController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanReportController.java @@ -69,7 +69,7 @@ public class TestPlanReportController { @GetMapping("/status/{planId}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REPORT_READ) - @CheckOwner(resourceId = "#planId", resourceType = "test_plan") + @CheckOwner(resourceId = "#planId", resourceType = "test_plan_report") public String getStatus(@PathVariable String planId) { TestPlanReport report = testPlanReportService.getTestPlanReport(planId); String status = report.getStatus();