74f1ce41ab30aa506ea6c1bd879e6d42ac596d55 hiram Wed Sep 25 12:24:12 2019 -0700 hard code a list of tables to check for protected data refs #24208 diff --git src/hg/hubApi/apiUtils.c src/hg/hubApi/apiUtils.c index 67ed571..cffcf1d 100644 --- src/hg/hubApi/apiUtils.c +++ src/hg/hubApi/apiUtils.c @@ -604,25 +604,49 @@ * When NO trackDb, can't tell at this point, will check that later */ { if (tdb) { if (tdbIsContainer(tdb) || tdbIsComposite(tdb) || tdbIsCompositeView(tdb) || tdbIsSuper(tdb)) return FALSE; else return TRUE; } else return TRUE; /* might be true */ } -boolean protectedTrack(struct trackDb *tdb) +boolean protectedTrack(struct trackDb *tdb, char *tableName) /* determine if track is off-limits protected data */ { boolean ret = FALSE; +/* this is a fixed list for now since there are so few and this + * takes care of the situation where the tableName might be for a table + * that has no trackDb entry + */ +if (sameOk(tableName, "cosmicRegions")) + ret = TRUE; +else if (sameOk(tableName, "decipherRaw")) + ret = TRUE; +else if (sameOk(tableName, "knownToDecipher")) + ret = TRUE; +else if (sameOk(tableName, "knownCanonToDecipher")) + ret = TRUE; +else if (sameOk(tableName, "decipherSnvsRaw")) + ret = TRUE; +else if (sameOk(tableName, "lovd")) + ret = TRUE; +else if (sameOk(tableName, "hgmd")) + ret = TRUE; +else + { + if (tdb) /* may not have a tdb at this time */ + { char *tbOff = trackDbSetting(tdb, "tableBrowser"); if (tbOff && startsWithWord("off", tbOff)) ret = TRUE; + } + } return ret; }