7d56cd6635651dfd4c9926d062d92ad7b65a3e80 chmalee Wed Jun 3 14:52:52 2026 -0700 More myVariants changes: make the share to accept a comma-sep list of usernames, allow both the read/edit flag and the usernames setting to be editable after creation. When editing usernames, add a confirmation if the field is left blank that this will make the share viewable/editable by anyone with the link, refs #33808 diff --git src/hg/lib/myVariants.c src/hg/lib/myVariants.c index 9829cf711f5..01cc7d321c5 100644 --- src/hg/lib/myVariants.c +++ src/hg/lib/myVariants.c @@ -533,39 +533,35 @@ /* The cart-cookie presence gate is belt-and-suspenders: it ensures the share * was once accepted into this session before we hit hgcentral. The real * authorization is the targetUser check below against the live share row. */ if (cart == NULL || !cartVarExists(cart, cartVar)) return NULL; struct sqlConnection *conn = hConnectCentral(); if (!sqlTableExists(conn, "myVariantsShares")) { hDisconnectCentral(&conn); return NULL; } struct myVariantsShare *share = myVariantsGetShareByToken(conn, token); hDisconnectCentral(&conn); if (share == NULL) return NULL; -if (isNotEmpty(share->targetUser)) - { - char *userName = getUserName(); - if (isEmpty(userName) || !sameString(share->targetUser, userName)) +if (!myVariantsShareAllowsUser(share, getUserName())) { myVariantsShareFree(&share); return NULL; } - } return share; } char *myVariantsResolveDbTableForCustomTrack(char *trackName, struct cart *cart) /* For a custom-track name of the form "myVariants_*", return the fully * qualified SQL table (db.tableName) holding the items. Handles both own * tracks and shared tracks. For shared tracks, revalidates the share against * hgcentral; returns NULL if the share has been revoked, downgraded out of * scope, or is not for the current user. */ { if (isEmpty(trackName)) return NULL; if (isMyVariantsSharedTrack(trackName)) { struct myVariantsShare *share = myVariantsResolveSharedTrack(trackName, cart);