diff --git a/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java b/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java index 8783e470a1..ac7ee87d27 100644 --- a/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java +++ b/backend/src/main/java/io/metersphere/commons/constants/PermissionConstants.java @@ -111,11 +111,14 @@ public class PermissionConstants { public static final String PROJECT_TRACK_PLAN_READ = "PROJECT_TRACK_PLAN:READ"; public static final String PROJECT_TRACK_PLAN_READ_CREATE = "PROJECT_TRACK_PLAN:READ+CREATE"; + public static final String PROJECT_TRACK_PLAN_READ_COPY = "PROJECT_TRACK_PLAN:READ+COPY"; public static final String PROJECT_TRACK_PLAN_READ_EDIT = "PROJECT_TRACK_PLAN:READ+EDIT"; public static final String PROJECT_TRACK_PLAN_READ_DELETE = "PROJECT_TRACK_PLAN:READ+DELETE"; public static final String PROJECT_TRACK_PLAN_READ_SCHEDULE = "PROJECT_TRACK_PLAN:READ+SCHEDULE"; public static final String PROJECT_TRACK_PLAN_READ_RELEVANCE_OR_CANCEL = "PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL"; + public static final String PROJECT_TRACK_PLAN_READ_CASE_BATCH_DELETE = "PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE"; public static final String PROJECT_TRACK_PLAN_READ_RUN = "PROJECT_TRACK_PLAN:READ+RUN"; + public static final String PROJECT_TRACK_PLAN_READ_CASE_BATCH_EDIT = "PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT"; public static final String PROJECT_TRACK_ISSUE_READ = "PROJECT_TRACK_ISSUE:READ"; public static final String PROJECT_TRACK_ISSUE_READ_CREATE = "PROJECT_TRACK_ISSUE:READ+CREATE"; diff --git a/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java b/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java index 09fc712fd1..dfad88f395 100644 --- a/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java +++ b/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java @@ -25,7 +25,6 @@ public class CustomFieldTemplateController { } @PostMapping("/update") - @RequiresPermissions(PermissionConstants.PROJECT_TEMPLATE_READ_CUSTOM) public void update(@RequestBody CustomFieldTemplate request) { customFieldTemplateService.update(request); } diff --git a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java index 3b1c5a355c..4a28503aa0 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestCaseController.java @@ -266,7 +266,7 @@ public class TestCaseController { } @PostMapping(value = "/edit/testPlan", consumes = {"multipart/form-data"}) - @RequiresPermissions(PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT) + @RequiresPermissions(value = {PermissionConstants.PROJECT_TRACK_CASE_READ_EDIT, PermissionConstants.PROJECT_TRACK_PLAN_READ_RUN}, logical = Logical.OR) @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogBeforeDetails(#request.id)", title = "#request.name", content = "#msClass.getLogDetails(#request.id)", msClass = TestCaseService.class) public String editTestCaseByTestPlan(@RequestPart("request") EditTestCaseRequest request, @RequestPart(value = "file", required = false) List files) { return testCaseService.editTestCase(request, files, Boolean.TRUE); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java index e3967cb145..d022f43a90 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -21,6 +21,7 @@ import io.metersphere.track.request.testplan.TestPlanRunRequest; import io.metersphere.track.request.testplancase.TestCaseRelevanceRequest; import io.metersphere.track.service.TestPlanProjectService; import io.metersphere.track.service.TestPlanService; +import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.*; @@ -193,7 +194,7 @@ public class TestPlanController { } @PostMapping("/copy/{id}") - @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_CREATE) + @RequiresPermissions(value = {PermissionConstants.PROJECT_TRACK_PLAN_READ_CREATE, PermissionConstants.PROJECT_TRACK_PLAN_READ_COPY}, logical = Logical.OR) @SendNotice(taskType = NoticeConstants.TaskType.TEST_PLAN_TASK, event = NoticeConstants.Event.CREATE, subject = "测试计划通知") public TestPlan copy(@PathVariable String id) { return testPlanService.copy(id); diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java index 3961460272..316d2162ba 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanTestCaseController.java @@ -15,6 +15,7 @@ import io.metersphere.track.request.testcase.TestPlanCaseBatchRequest; import io.metersphere.track.request.testplancase.QueryTestPlanCaseRequest; import io.metersphere.track.request.testplancase.TestPlanFuncCaseBatchRequest; import io.metersphere.track.service.TestPlanTestCaseService; +import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.web.bind.annotation.*; @@ -132,14 +133,14 @@ public class TestPlanTestCaseController { } @PostMapping("/batch/edit") - @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_RUN) + @RequiresPermissions(value = {PermissionConstants.PROJECT_TRACK_PLAN_READ_RUN, PermissionConstants.PROJECT_TRACK_PLAN_READ_CASE_BATCH_EDIT}, logical = Logical.OR) @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.BATCH_UPDATE, beforeEvent = "#msClass.batchLogDetails(#request.ids)", content = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanTestCaseService.class) public void editTestCaseBath(@RequestBody TestPlanCaseBatchRequest request) { testPlanTestCaseService.editTestCaseBath(request); } @PostMapping("/batch/delete") - @RequiresPermissions(PermissionConstants.PROJECT_TRACK_PLAN_READ_RELEVANCE_OR_CANCEL) + @RequiresPermissions(value = {PermissionConstants.PROJECT_TRACK_PLAN_READ_RELEVANCE_OR_CANCEL, PermissionConstants.PROJECT_TRACK_PLAN_READ_CASE_BATCH_DELETE}, logical = Logical.OR) @MsAuditLog(module = OperLogModule.TRACK_TEST_PLAN, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestPlanTestCaseService.class) public void deleteTestCaseBath(@RequestBody TestPlanCaseBatchRequest request) { testPlanTestCaseService.deleteTestCaseBath(request); diff --git a/frontend/src/business/components/track/case/components/TestCaseIssueRelate.vue b/frontend/src/business/components/track/case/components/TestCaseIssueRelate.vue index d0659da422..7201da0edb 100644 --- a/frontend/src/business/components/track/case/components/TestCaseIssueRelate.vue +++ b/frontend/src/business/components/track/case/components/TestCaseIssueRelate.vue @@ -1,7 +1,11 @@