-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add option to disable searching in the user dir #4895
Conversation
We still populate it, as it can still be accessed via the admin API.
Codecov Report
@@ Coverage Diff @@
## develop #4895 +/- ##
===========================================
- Coverage 77.96% 77.95% -0.01%
===========================================
Files 326 326
Lines 33958 33962 +4
Branches 5601 5602 +1
===========================================
Hits 26474 26474
- Misses 5863 5867 +4
Partials 1621 1621 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again:
- should we disable the insertion code
- can has tests please
Co-Authored-By: erikjohnston <erikj@jki.re>
Two things: 1) there's an admin API that uses user dir that isn't disabled, and 2) we'd want to have some way of correctly restarting the insertions if we flipped it off and on, which I'd like to avoid for now. |
@@ -59,6 +59,12 @@ def on_POST(self, request): | |||
requester = yield self.auth.get_user_by_req(request, allow_guest=False) | |||
user_id = requester.user.to_string() | |||
|
|||
if not self.hs.config.user_directory_search_enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't moved that into __init__
as there's no way of getting at servlets after they're set up afaik. We could do various contortions in the test to make it work, but I don't know whether that is better or worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
We still populate it, as it can still be accessed via the admin API.