tds/src/main/java/thredds/core/DatasetManager.java
public boolean resourceControlOk(HttpServletRequest req, HttpServletResponse res, String reqPath) {
    if (null == reqPath)
      reqPath = TdsPathUtils.extractPath(req, null);

    // see if its under resource control
    String rc = null;
    DataRootManager.DataRootMatch match = dataRootManager.findDataRootMatch(reqPath);
    if (match != null) {
      rc = match.dataRoot.getRestrict(); // datasetScan, featCollection are restricted at the dataRoot
    }

    if (rc == null) {
      rc = datasetTracker.findResourceControl(reqPath); // regular datasets tracked here
    }

    return resourceAuthorized(req, res, rc);
  }
public boolean resourceControlOk(HttpServletRequest req, HttpServletResponse res, String reqPath) {
    if (null == reqPath)
      reqPath = TdsPathUtils.extractPath(req, null);

    // see if its under resource control
    String rc = null;
    DataRootManager.DataRootMatch match = dataRootManager.findDataRootMatch(reqPath);
    if (match != null) {
      rc = match.dataRoot.getRestrict(); // datasetScan, featCollection are restricted at the dataRoot
    }

    if (rc == null) {
      rc = datasetTracker.findResourceControl(reqPath); // regular datasets tracked here
    }

    return resourceAuthorized(req, res, rc);
  }
public boolean resourceControlOk ( HttpServletRequest req , HttpServletResponse res , String reqPath ) { if ( null == reqPath ) reqPath = TdsPathUtils . extractPath ( req , null ) ; // see if its under resource control String rc = null ; DataRootManager . DataRootMatch match = dataRootManager . findDataRootMatch ( reqPath ) ; if ( match != null ) { rc = match . dataRoot . getRestrict ( ) ; // datasetScan, featCollection are restricted at the dataRoot } if ( rc == null ) { rc = datasetTracker . findResourceControl ( reqPath ) ; // regular datasets tracked here } return resourceAuthorized ( req , res , rc ) ; }
Check if this is making a request for a restricted dataset, and if so, if its allowed.

@param req     the request
@param res     the response
@param reqPath the request path; if null, use req.getPathInfo()
@return true if ok to proceed. If false, the appropriate error or redirect message has been sent, the caller only needs to return.
Check if this is making a request for a restricted dataset and if so if its allowed .