Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Search in columns 'name' and 'displayname' in the admin users endpoint #7377

Merged
merged 8 commits into from
Aug 25, 2020
3 changes: 2 additions & 1 deletion synapse/rest/admin/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ async def on_GET(self, request):

start = parse_integer(request, "from", default=0)
limit = parse_integer(request, "limit", default=100)
name = parse_string(request, "name", default=None)
user_id = parse_string(request, "user_id", default=None)
name = parse_string(request, "name", default=user_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still doesn't address the concern I mentioned. Now user_id will return results from both displayname and name columns. This breaks backwards compatibility.

What I'm asking for is:

  • If user_id is provided, results are filtered according to the name column only.
  • If name is provided, results are filtered according to the name and displayname columns.
  • If both user_id and name are provided, results are filtered according to the name column only.

guests = parse_boolean(request, "guests", default=True)
deactivated = parse_boolean(request, "deactivated", default=False)

Expand Down