diff --git a/project-management/backend/src/main/java/io/metersphere/controller/ApiTemplateController.java b/project-management/backend/src/main/java/io/metersphere/controller/ApiTemplateController.java index 2b6aba6ee2..35040d4554 100644 --- a/project-management/backend/src/main/java/io/metersphere/controller/ApiTemplateController.java +++ b/project-management/backend/src/main/java/io/metersphere/controller/ApiTemplateController.java @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; import io.metersphere.base.domain.ApiTemplate; import io.metersphere.commons.constants.OperLogConstants; import io.metersphere.commons.constants.OperLogModule; +import io.metersphere.commons.constants.PermissionConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.dto.ApiTemplateDTO; @@ -55,13 +56,15 @@ public class ApiTemplateController { } @GetMapping({"/option/{projectId}", "/option"}) - @RequiresPermissions(value = {"PROJECT_TEMPLATE:READ+API_TEMPLATE", "PROJECT_TEMPLATE:READ"}, logical = Logical.OR) + @RequiresPermissions(value = {"PROJECT_TEMPLATE:READ+API_TEMPLATE", "PROJECT_TEMPLATE:READ", + PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_CREATE, PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_EDIT}, logical = Logical.OR) public List list(@PathVariable(required = false) String projectId) { return apiTemplateService.getOption(projectId); } @GetMapping("/get-template/relate/{projectId}") - @RequiresPermissions(value = {"PROJECT_TEMPLATE:READ+API_TEMPLATE", "PROJECT_TEMPLATE:READ"}, logical = Logical.OR) + @RequiresPermissions(value = {"PROJECT_TEMPLATE:READ+API_TEMPLATE", "PROJECT_TEMPLATE:READ", + PermissionConstants.PROJECT_API_DEFINITION_READ}, logical = Logical.OR) public ApiTemplateDTO getTemplate(@PathVariable String projectId) { return apiTemplateService.getTemplate(projectId); } diff --git a/project-management/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java b/project-management/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java index be4c453b40..b8def3fa57 100644 --- a/project-management/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java +++ b/project-management/backend/src/main/java/io/metersphere/controller/IssueTemplateController.java @@ -60,7 +60,8 @@ public class IssueTemplateController { } @GetMapping({"/option/{projectId}", "/option"}) - @RequiresPermissions(PermissionConstants.PROJECT_TEMPLATE_READ_ISSUE_TEMPLATE) + @RequiresPermissions(value = {PermissionConstants.PROJECT_TEMPLATE_READ_ISSUE_TEMPLATE, + PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_CREATE, PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_EDIT}, logical = Logical.OR) public List list(@PathVariable(required = false) String projectId) { return issueTemplateService.getOption(projectId); } diff --git a/project-management/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java b/project-management/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java index 9611a9184f..de3ca66ac4 100644 --- a/project-management/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java +++ b/project-management/backend/src/main/java/io/metersphere/controller/TestCaseTemplateController.java @@ -58,7 +58,8 @@ public class TestCaseTemplateController { } @GetMapping({"/option/{projectId}", "/option"}) - @RequiresPermissions(PermissionConstants.PROJECT_TEMPLATE_READ_CASE_TEMPLATE) + @RequiresPermissions(value = {PermissionConstants.PROJECT_TEMPLATE_READ_CASE_TEMPLATE, + PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_CREATE, PermissionConstants.WORKSPACE_PROJECT_MANAGER_READ_EDIT}, logical = Logical.OR) public List list(@PathVariable(required = false) String projectId) { return testCaseTemplateService.getOption(projectId); }