DotConnect dc = new DotConnect();
dc.setSQL(sb.toString());
ArrayList<HashMap<String, String>> results = dc.getResults();
for (HashMap<String, String> map : results) {
PermissionAsset pa = new PermissionAsset();
Report report = new Report();
report.setInode(map.get("inode"));
report.setReportName(map.get("report_name"));
report.setReportDescription(map.get("report_description"));
report.setRequiresInput(Parameter.getBooleanFromString(map.get("requires_input")));
report.setOwner(map.get("owner"));
report.setWebFormReport(Parameter.getBooleanFromString(map.get("web_form_report")));
ArrayList p = new ArrayList();
if(isAdmin || user.equals(map.get("owner"))){
p.add(new Long(4));
}else{
p.add(new Long(UtilMethods.parseLong(map.get("max_permission"),0)));
}
pa.setPermissions(p);
pa.setAsset(report);
permissionReports.add(pa);
}
return permissionReports;
}