fix: 只读用户不能删除测试报告

This commit is contained in:
Captain.B 2020-12-23 10:25:38 +08:00
parent 6baf28bed3
commit 6a2229d98c
2 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,7 @@ public class APIReportController {
} }
@PostMapping("/delete") @PostMapping("/delete")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER}, logical = Logical.OR)
public void delete(@RequestBody DeleteAPIReportRequest request) { public void delete(@RequestBody DeleteAPIReportRequest request) {
apiReportService.delete(request); apiReportService.delete(request);
} }
@ -70,6 +71,7 @@ public class APIReportController {
} }
@PostMapping("/batch/delete") @PostMapping("/batch/delete")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER}, logical = Logical.OR)
public void deleteAPIReportBatch(@RequestBody DeleteAPIReportRequest reportRequest) { public void deleteAPIReportBatch(@RequestBody DeleteAPIReportRequest reportRequest) {
apiReportService.deleteAPIReportBatch(reportRequest); apiReportService.deleteAPIReportBatch(reportRequest);
} }

View File

@ -53,6 +53,7 @@ public class PerformanceReportController {
} }
@PostMapping("/delete/{reportId}") @PostMapping("/delete/{reportId}")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER}, logical = Logical.OR)
public void deleteReport(@PathVariable String reportId) { public void deleteReport(@PathVariable String reportId) {
reportService.deleteReport(reportId); reportService.deleteReport(reportId);
} }
@ -130,6 +131,7 @@ public class PerformanceReportController {
} }
@PostMapping("/batch/delete") @PostMapping("/batch/delete")
@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER}, logical = Logical.OR)
public void deleteReportBatch(@RequestBody DeleteReportRequest reportRequest) { public void deleteReportBatch(@RequestBody DeleteReportRequest reportRequest) {
reportService.deleteReportBatch(reportRequest); reportService.deleteReportBatch(reportRequest);
} }