final AclManager aclManager = AclManager.getInstance();
return this.jdbcTemplate.query(sql.toString(), new RowMapper() {
public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
Item item = null;
int defid = rs.getInt("defid");
//Map<Character, Boolean> permission = aclManager.getPermission(defid, endpoint);
Map<Character, Boolean> permission = aclManager.getPermission(defid, endpoint, comCode, rs.getString("parentfolder"));
if (permission.containsKey(AclManager.PERMISSION_MANAGEMENT) || permission.containsKey(cPermission)) {
String name = rs.getString("name");
String objtype = rs.getString("objtype");
String parentFolder = rs.getString("parentfolder");
item = new Item();
item.setId(String.valueOf(defid));
item.setName(name);
item.setParent(parentFolder);
item.setObj(objtype);
Character[] permissions = null;
if (permission.size() > 0)
permissions = (Character[]) permission.keySet().toArray(new Character[permission.size()]);
item.setAuthority(permissions);
}
return item;
}
});
}