code: protected boolean isOutOfOu(String resourceName) {
  
          if (resourceName == null) {
              return true;
          }
          try {
              boolean notOk = true;
              for (CmsResource res : OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
                  m_cms,
                  m_parentOu.getValue())) {
                  if (resourceName.startsWith(res.getRootPath())) {
                      notOk = false;
                  }
              }
              return notOk;
          } catch (CmsException e) {
              //
          }
          return true;
      }
docs: Check if resource is in parent OU.<p>
  
  @param resourceName to check
  @return boolean