code: protected void addFlagCondition(CmsSelectQuery select, TableAlias users, int flags, boolean allowCore) {
  
          if (flags != 0) {
              I_CmsQueryFragment condition = createFlagCondition(users, flags);
              if (allowCore) {
                  I_CmsQueryFragment coreCondition = createCoreCondition(users);
                  select.addCondition(CmsSqlBooleanClause.makeOr(condition, coreCondition));
              } else {
                  select.addCondition(condition);
              }
          }
      }
docs: Adds flag checking conditions to an SQL query.<p>
  
  @param select the query
  @param users the user table alias
  @param flags the flags
  @param allowCore set to true if core users should not be filtered out