code: public static List<CmsProject> getAvailableProjects(CmsObject cms) {
  
          // get all project information
          List<CmsProject> allProjects;
          try {
              String ouFqn = "";
              CmsUserSettings settings = new CmsUserSettings(cms);
              if (!settings.getListAllProjects()) {
                  ouFqn = cms.getRequestContext().getCurrentUser().getOuFqn();
              }
              allProjects = new ArrayList<CmsProject>(
                  OpenCms.getOrgUnitManager().getAllAccessibleProjects(cms, ouFqn, settings.getListAllProjects()));
              Iterator<CmsProject> itProjects = allProjects.iterator();
              while (itProjects.hasNext()) {
                  CmsProject prj = itProjects.next();
                  if (prj.isHiddenFromSelector()) {
                      itProjects.remove();
                  }
              }
          } catch (CmsException e) {
              // should usually never happen
              LOG.error(e.getLocalizedMessage(), e);
              allProjects = Collections.emptyList();
          }
          return allProjects;
      }
docs: Returns the available projects.<p>
  
  @param cms the CMS context
  
  @return the available projects