fix: 只读用户访问用例详情页面跳转到默认页

This commit is contained in:
chenjianxing 2021-05-10 10:03:46 +08:00 committed by jianxing
parent e2d78eecd5
commit 18492ec568
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,7 @@ public class TestCaseTemplateController {
} }
@PostMapping("/list/{goPage}/{pageSize}") @PostMapping("/list/{goPage}/{pageSize}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public Pager<List<TestCaseTemplateWithBLOBs>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseQueryRequest request) { public Pager<List<TestCaseTemplateWithBLOBs>> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseQueryRequest request) {
Page<List<TestCaseTemplateWithBLOBs>> page = PageHelper.startPage(goPage, pageSize, true); Page<List<TestCaseTemplateWithBLOBs>> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testCaseTemplateService.list(request)); return PageUtils.setPageInfo(page, testCaseTemplateService.list(request));
@ -48,11 +49,13 @@ public class TestCaseTemplateController {
} }
@GetMapping("/option/{workspaceId}") @GetMapping("/option/{workspaceId}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public List<TestCaseTemplate> list(@PathVariable String workspaceId) { public List<TestCaseTemplate> list(@PathVariable String workspaceId) {
return testCaseTemplateService.getOption(workspaceId); return testCaseTemplateService.getOption(workspaceId);
} }
@GetMapping("/get/relate/{projectId}") @GetMapping("/get/relate/{projectId}")
@RequiresRoles(value = {RoleConstants.TEST_USER, RoleConstants.TEST_MANAGER, RoleConstants.TEST_VIEWER}, logical = Logical.OR)
public TestCaseTemplateDao getTemplate(@PathVariable String projectId) { public TestCaseTemplateDao getTemplate(@PathVariable String projectId) {
return testCaseTemplateService.getTemplate(projectId); return testCaseTemplateService.getTemplate(projectId);
} }