Search backend: skip private repo resolution for unauthed users
Created by: camdencheek
On sourcegraph.com, we are currently trying to list private repositories for a user even when the user is unauthed. This is adding between 500 and 1000ms of additional latency to every unauthed search request on sourcegraph.com because the query takes a long time when not scoped to a user.
This PR just modifies the PrivateReposForUser
func to:
- Pull the current actor from the context rather than taking an explicit userID
- Skip the lookup entirely when the user is unauthed and we're in SOURCEGRAPHDOTCOM_MODE