code: protected void internalValidateResourceForOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, String rootPath)
      throws CmsException {
  
          CmsResource parentResource = m_driverManager.readResource(
              dbc,
              ORGUNIT_BASE_FOLDER + orgUnit.getName(),
              CmsResourceFilter.ALL);
          // assume not in scope
          boolean found = false;
          // iterate parent paths
          Iterator<String> itParentPaths = internalResourcesForOrgUnit(dbc, parentResource).iterator();
          // until the given resource is found in scope
          while (!found && itParentPaths.hasNext()) {
              String parentPath = itParentPaths.next();
              // check the scope
              if (rootPath.startsWith(parentPath)) {
                  found = true;
              }
          }
          // if not in scope throw exception
          if (!found) {
              throw new CmsException(
                  Messages.get().container(
                      Messages.ERR_PATH_NOT_IN_PARENT_ORGUNIT_SCOPE_2,
                      orgUnit.getName(),
                      dbc.removeSiteRoot(rootPath)));
          }
      }
docs: Validates the given root path to be in the scope of the resources of the given organizational unit.<p>
  
  @param dbc the current db context
  @param orgUnit the organizational unit
  @param rootPath the root path to check
  
  @throws CmsException if something goes wrong