code: private boolean ouIsOK(CmsOrganizationalUnit ou) {
  
          try {
              for (CmsResource res : OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
                  m_clonedCms,
                  ou.getName())) {
  
                  if (m_simpleFieldParentFolderName.getValue().startsWith(res.getRootPath())) {
                      return true;
                  }
  
              }
          } catch (CmsException e) {
              LOG.error("Unable to read Resources for Org Unit", e);
          }
          return false;
      }
docs: Checks if given Ou has resources matching to currently set parent folder.<p>
  
  @param ou to check
  @return true if ou is ok for parent folder