code: protected void addAllowedOuCondition(
          CmsSelectQuery select,
          TableAlias users,
          List<CmsOrganizationalUnit> allowedOus) {
  
          if ((allowedOus != null) && !allowedOus.isEmpty()) {
              CmsCompositeQueryFragment ouCondition = new CmsCompositeQueryFragment();
              ouCondition.setPrefix("(");
              ouCondition.setSuffix(")");
              ouCondition.setSeparator(" OR ");
              for (CmsOrganizationalUnit ou : allowedOus) {
                  String ouName = CmsStringUtil.joinPaths("/", ou.getName());
                  ouCondition.add(new CmsSimpleQueryFragment(users.column(colOu()) + " = ? ", ouName));
              }
              select.addCondition(ouCondition);
          }
      }
docs: Adds OU conditions to an SQL query.<p>
  
  @param select the query
  @param users the user table alias
  @param allowedOus the allowed ous