f80647089b6f923ae55acb0a802051d4ff9d0881
braney
  Wed Oct 18 17:25:07 2023 -0700
Revert "don't check for data accessibility, just trust trackDb Refs #32299"

This reverts commit 4140b3fc69c92c3331daca4f7bf35fafc81a5b1f.

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 3893f82..36ea25a 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -3948,34 +3948,32 @@
 
 boolean trackDataAccessible(char *database, struct trackDb *tdb)
 /* Return TRUE if underlying data are accessible - meaning the track has either
  * a bigDataUrl with remote URL (http:// etc), a bigDataUrl with an existing local file,
  * or a database table with the same name.
  * Note: this returns FALSE for composite tracks; use this on subtracks or simple tracks. */
 {
 return trackDataAccessibleHash(database, tdb, NULL);
 }
 
 
 static void addTrackIfDataAccessible(char *database, struct trackDb *tdb,
 	       boolean privateHost, struct trackDb **tdbRetList)
 /* check if a trackDb entry should be included in display, and if so
  * add it to the list, otherwise free it */
-/* NOTE: we no longer check to see if the data is available in CGIs
- * since this is done by hTrackDb at trackDb build time */
 {
-if (!tdb->private || privateHost)
+if ((!tdb->private || privateHost) && trackDataAccessible(database, tdb))
     slAddHead(tdbRetList, tdb);
 else if (tdbIsDownloadsOnly(tdb))
     {
     // While it would be good to make table NULL, since we should support tracks
     // without tables (composties, etc) and even data tracks without tables (bigWigs).
     // However, some CGIs still need careful bullet-proofing.  I have done so with
     //   hgTrackUi, hgTracks, hgTable and hgGenome
     //if (tdb->table != NULL && sameString(tdb->table,tdb->track))
     //    tdb->table = NULL;
     slAddHead(tdbRetList, tdb);
     }
 else
     trackDbFree(&tdb);
 }