*/
public static void verifyAccessApproved(DataSourceRequest req) throws DataSourceException {
// The library requires the request to be same origin for JSON and JSONP.
// Check for (!csv && !html && !tsv-excel) to make sure any output type
// added in the future will be restricted to the same domain by default.
OutputType outType = req.getDataSourceParameters().getOutputType();
if (outType != OutputType.CSV && outType != OutputType.TSV_EXCEL
&& outType != OutputType.HTML && !req.isSameOrigin()) {
throw new DataSourceException(ReasonType.ACCESS_DENIED,
"Unauthorized request. Cross domain requests are not supported.");
}