From 549971b00651e6337f4e21afb67f719f643f51e1 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 16 Sep 2021 10:52:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dcheckowner=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=B2=A1=E6=9C=89=E5=B0=86=E8=AF=A6=E7=BB=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=E5=9C=A8=E9=A1=B5=E9=9D=A2=E4=B8=8A?= =?UTF-8?q?=20--bug=3D1006666=20--user=3D=E5=88=98=E7=91=9E=E6=96=8C=20?= =?UTF-8?q?=E3=80=90=E6=B6=88=E6=81=AF=E4=B8=AD=E5=BF=83=E3=80=91=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E9=80=9A=E7=9F=A5=E8=B7=B3=E8=BD=AC=E6=8A=A5=E9=94=99?= =?UTF-8?q?=20https://www.tapd.cn/55049933/s/1047060?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/service/CheckPermissionService.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/CheckPermissionService.java b/backend/src/main/java/io/metersphere/service/CheckPermissionService.java index dbd921ad75..bb6539d20e 100644 --- a/backend/src/main/java/io/metersphere/service/CheckPermissionService.java +++ b/backend/src/main/java/io/metersphere/service/CheckPermissionService.java @@ -4,6 +4,7 @@ import io.metersphere.base.domain.Group; import io.metersphere.base.domain.UserGroup; import io.metersphere.base.mapper.ext.*; import io.metersphere.commons.constants.UserGroupType; +import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.dto.UserDTO; import io.metersphere.i18n.Translator; @@ -39,7 +40,7 @@ public class CheckPermissionService { return; } if (!projectIds.contains(projectId)) { - throw new RuntimeException(Translator.get("check_owner_project")); + MSException.throwException(Translator.get("check_owner_project")); } } @@ -69,7 +70,7 @@ public class CheckPermissionService { int result = extApiTestMapper.checkApiTestOwner(testId, projectIds); if (result == 0) { - throw new RuntimeException(Translator.get("check_owner_test")); + MSException.throwException(Translator.get("check_owner_test")); } } @@ -85,7 +86,7 @@ public class CheckPermissionService { int result = extLoadTestMapper.checkLoadTestOwner(testId, projectIds); if (result == 0) { - throw new RuntimeException(Translator.get("check_owner_test")); + MSException.throwException(Translator.get("check_owner_test")); } } @@ -97,7 +98,7 @@ public class CheckPermissionService { int result = extTestCaseMapper.checkIsHave(caseId, projectIds); if (result == 0) { - throw new RuntimeException(Translator.get("check_owner_case")); + MSException.throwException(Translator.get("check_owner_case")); } } @@ -108,7 +109,7 @@ public class CheckPermissionService { } int result = extTestPlanMapper.checkIsHave(planId, projectIds); if (result == 0) { - throw new RuntimeException(Translator.get("check_owner_plan")); + MSException.throwException(Translator.get("check_owner_plan")); } } @@ -119,7 +120,7 @@ public class CheckPermissionService { } int result = extTestCaseReviewMapper.checkIsHave(reviewId, projectIds); if (result == 0) { - throw new RuntimeException(Translator.get("check_owner_review")); + MSException.throwException(Translator.get("check_owner_review")); } } }