fix(接口测试): 修复checkOwner报错的缺陷
This commit is contained in:
parent
2c1b82273f
commit
32bdfe2c53
|
@ -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"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue