e7264355c83a0d0875b372b7ad26162adb363f6c chmalee Tue May 12 13:20:28 2026 -0700 myVariants v1 follow-ups: CT edit gate, anon-user button gate, hgc duplicate link, item-name synthesis from ref/alt or HGVS, refs #33808 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index cd2668d9b1e..cb57b7d7557 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -8880,31 +8880,32 @@ if (!multiRegionButtonTop) { printMultiRegionButton(); hPrintf(" "); } hButtonMaybePressed("hgt.toggleRevCmplDisp", "Reverse", revCmplDisp ? "Show forward strand at this location - keyboard shortcut: r, then v" : "Show reverse strand at this location - keyboard shortcut: r, then v", NULL, revCmplDisp); hPrintf(" "); hButtonWithOnClick("hgt.setWidth", "Resize", "Resize image width to browser window size - keyboard shortcut: r, then s", "hgTracksSetWidth()"); // put up the My Variants dialog if the hg.conf statement is present -if (cfgOptionBooleanDefault("doMyVariants", FALSE)) +// and the visitor is logged in (anonymous users can't write to the table). +if (cfgOptionBooleanDefault("doMyVariants", FALSE) && getUserName() != NULL) { hPrintf("<button id=\"myVariantsButton\" title=\"Add an item to the My Annotations track\">Add Annotation</button>"); jsInline("var doMyVariants = true;\n"); jsInlineF("var userIsLoggedIn = %s;\n", getUserName() != NULL ? "true" : "false"); // Get existing project values for dropdown char *userName = getUserName(); if (userName) { struct slName *projects = myVariantsGetProjects(userName); if (projects) { struct jsonElement *projectList = newJsonList(NULL); struct slName *proj; for (proj = projects; proj != NULL; proj = proj->next) jsonListAdd(projectList, newJsonString(proj->name));