From 8ce127cfc51984e6280b5688b4b648d22932f39a Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 12 Jun 2024 11:53:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AF=84=E5=AE=A1=E6=89=93=E5=BC=80=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtCheckOwnerMapper.xml | 14 ++++++++------ .../controller/TestReviewTestCaseController.java | 2 +- .../service/TestReviewTestCaseService.java | 8 ++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/ExtCheckOwnerMapper.xml b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/ExtCheckOwnerMapper.xml index cac10e8745..b59d16bad5 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/ExtCheckOwnerMapper.xml +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/ExtCheckOwnerMapper.xml @@ -4,12 +4,14 @@ diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java index dc1ae57aa7..9a627b7bd2 100644 --- a/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java +++ b/test-track/backend/src/main/java/io/metersphere/controller/TestReviewTestCaseController.java @@ -104,7 +104,7 @@ public class TestReviewTestCaseController { @GetMapping("/get/{reviewId}") @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REVIEW_READ) public TestReviewCaseDTO get(@PathVariable String reviewId) { - return testReviewTestCaseService.get(reviewId, SessionUtils.getCurrentProjectId()); + return testReviewTestCaseService.get(reviewId, SessionUtils.getUserId()); } @GetMapping("/reviewer/status/{id}") diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java index 02bdfd117a..b1f69a3c27 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java @@ -459,9 +459,9 @@ public class TestReviewTestCaseService { return comments; } - public TestReviewCaseDTO get(String testReviewTestCaseId, String currentProjectId) { + public TestReviewCaseDTO get(String testReviewTestCaseId, String currentUserId) { TestReviewCaseDTO testReviewCaseDTO = extTestReviewCaseMapper.get(testReviewTestCaseId); - checkReviewCaseOwner(testReviewCaseDTO.getCaseId(), currentProjectId); + checkReviewCaseOwner(testReviewCaseDTO.getCaseId(), currentUserId); testReviewCaseDTO.setFields(testCaseService.getCustomFieldByCaseId(testReviewCaseDTO.getCaseId())); return testReviewCaseDTO; } @@ -881,8 +881,8 @@ public class TestReviewTestCaseService { } } - private void checkReviewCaseOwner(String caseId, String currentProjectId) { - boolean hasPermission = extCheckOwnerMapper.checkoutOwner("test_case", currentProjectId, List.of(caseId)); + private void checkReviewCaseOwner(String caseId, String currentUserId) { + boolean hasPermission = extCheckOwnerMapper.checkoutOwner("test_case", currentUserId, List.of(caseId)); if (!hasPermission) { MSException.throwException(Translator.get("check_owner_case")); }