Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

39 рядки
1.4 KiB

  1. # Copyright 2017 New Vector Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from typing import Any
  15. from synapse.types import JsonDict
  16. from ._base import Config
  17. class UserDirectoryConfig(Config):
  18. """User Directory Configuration
  19. Configuration for the behaviour of the /user_directory API
  20. """
  21. section = "userdirectory"
  22. def read_config(self, config: JsonDict, **kwargs: Any) -> None:
  23. user_directory_config = config.get("user_directory") or {}
  24. self.user_directory_search_enabled = user_directory_config.get("enabled", True)
  25. self.user_directory_search_all_users = user_directory_config.get(
  26. "search_all_users", False
  27. )
  28. self.user_directory_search_prefer_local_users = user_directory_config.get(
  29. "prefer_local_users", False
  30. )
  31. self.show_locked_users = user_directory_config.get("show_locked_users", False)