fix(接口测试): 修复checkOwner报错的缺陷

This commit is contained in:
wxg0103 2024-06-27 14:19:35 +08:00 committed by 刘瑞斌
parent 2c1b82273f
commit 32bdfe2c53
2 changed files with 9 additions and 1 deletions

View File

@ -2201,6 +2201,14 @@ public class ApiScenarioService {
if (scenario == null) { if (scenario == null) {
return; return;
} }
long count = SessionUtils.getUser().getGroups()
.stream()
.filter(g -> StringUtils.equals(userId, UserGroupConstants.SUPER_GROUP))
.count();
if (count > 0) {
return;
}
if (!extCheckOwnerMapper.checkoutOwner("api_scenario", userId, List.of(scenarioId))) { if (!extCheckOwnerMapper.checkoutOwner("api_scenario", userId, List.of(scenarioId))) {
MSException.throwException(Translator.get("check_owner_case")); MSException.throwException(Translator.get("check_owner_case"));
} }

View File

@ -69,7 +69,7 @@ public class TestPlanReportController {
@GetMapping("/status/{planId}") @GetMapping("/status/{planId}")
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_REPORT_READ) @RequiresPermissions(PermissionConstants.PROJECT_TRACK_REPORT_READ)
@CheckOwner(resourceId = "#planId", resourceType = "test_plan") @CheckOwner(resourceId = "#planId", resourceType = "test_plan_report")
public String getStatus(@PathVariable String planId) { public String getStatus(@PathVariable String planId) {
TestPlanReport report = testPlanReportService.getTestPlanReport(planId); TestPlanReport report = testPlanReportService.getTestPlanReport(planId);
String status = report.getStatus(); String status = report.getStatus();