if (!PermissionUtils.isAuthorized(Permission.READ_ACCESS,orgId,appId)){
return new ModelAndView("403");
}
Scan scan = null;
if (scanId != null) {
scan = scanService.loadScan(scanId);
scanService.loadStatistics(scan);
}
if (scan == null) {
if (orgId != null && appId != null) {
return new ModelAndView("redirect:/organizations/" + orgId + "/applications/" + appId + "/scans");
} else if (orgId != null) {
return new ModelAndView("redirect:/organizations/" + orgId);
} else {
return new ModelAndView("redirect:/");
}
}
long numFindings = scanService.getFindingCount(scanId);
ModelAndView mav = new ModelAndView("scans/detail");
mav.addObject("totalFindings", numFindings);
mav.addObject(scan);
mav.addObject("vulnData", scan.getReportList());
return mav;
}