code: protected List<CmsGroup> getGroups() throws CmsException {
  
          List<CmsGroup> groups = new ArrayList<CmsGroup>();
          if (getParamUser() != null) {
              groups.addAll(getCms().getGroupsOfUser(getParamUser(), false));
          } else {
              groups.addAll(OpenCms.getRoleManager().getManageableGroups(getCms(), "", true));
          }
          if (getParamFlags() != null) {
              int flags = Integer.parseInt(getParamFlags());
              CmsPrincipal.filterFlag(groups, flags);
          }
          if ((getParamOufqn() != null) && !getParamOufqn().equals("null")) {
              Iterator<CmsGroup> groupsIter = groups.iterator();
              while (groupsIter.hasNext()) {
                  CmsGroup group = groupsIter.next();
                  if (!group.getOuFqn().startsWith(getParamOufqn())) {
                      groupsIter.remove();
                  }
              }
          }
          return groups;
      }
docs: Returns the groups to show for selection.<p>
  
  @return A list of group objects
  
  @throws CmsException if womething goes wrong