[x]
):Gitea code search works across all repositories regardless of user permissions (reproduced even if the user is not logged in)
I'll give this a look.
@DNAlchemist I'm unable to reproduce, neither with my prod version (1.9.2) or the latest master (79c8bc0e51db9ef1579b72d0510cac9aaded06db).
Isn't it possible that you have some misbehaving caching entity in between (e.g. a proxy)?
My test workflow was:
With an admin user:
http://__my_server__/explore/code
watermelon
).watermelon
in a file. Most of them are marked as private
.[View File]
button from the results; they all work as expected.Then I've created a testuser
user, no special permissions, no teams. I've logged in and:
http://__my_server__/explore/code
watermelon
as a search term.private
.[View File]
button from the results; they all work as expected.Finally, I've logged off, set REQUIRE_SIGNIN_VIEW=off
(my normal setting is on
) and:
http://__my_server__/explore/code
watermelon
as a search term.private
.[View File]
button from the results; they all work as expected.@guillep2k I think the problem is when you changed some repository from public to private or removed some user's permissions of some repositories. the indexer may not be updated.
@guillep2k I think the problem is when you changed some repository from public to private or removed some user's permissions of some repositories. the indexer may not be updated.
@lunny Whether or not the indexer is updated should not affect this. The indexer processes all repositories, no matter their status. The search function however filters by permissions at the moment of the user action, so I don't see how the results list could be outdated:
https://github.com/go-gitea/gitea/blob/c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7/routers/home.go#L303-L309
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
This issue has been automatically closed because of inactivity. You can re-open it if needed.
Most helpful comment
@lunny Whether or not the indexer is updated should not affect this. The indexer processes all repositories, no matter their status. The search function however filters by permissions at the moment of the user action, so I don't see how the results list could be outdated:
https://github.com/go-gitea/gitea/blob/c03d75fbd51174d0e7ffdbaf9e9e253438d06cf7/routers/home.go#L303-L309