Merge pull request #5731 from matrix-org/jaywink/admin-user-list-user-type

Add `user_type` to returned fields in admin API user list endpoints
pull/5733/head
Jason Robinson 2019-07-22 16:28:51 +03:00 committed by GitHub
commit 8e513e7afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

1
changelog.d/5731.misc Normal file
View File

@ -0,0 +1 @@
Return 'user_type' in admin API user endpoints results.

View File

@ -469,7 +469,7 @@ class DataStore(
return self._simple_select_list(
table="users",
keyvalues={},
retcols=["name", "password_hash", "is_guest", "admin"],
retcols=["name", "password_hash", "is_guest", "admin", "user_type"],
desc="get_users",
)
@ -494,7 +494,7 @@ class DataStore(
orderby=order,
start=start,
limit=limit,
retcols=["name", "password_hash", "is_guest", "admin"],
retcols=["name", "password_hash", "is_guest", "admin", "user_type"],
)
count = yield self.runInteraction("get_users_paginate", self.get_user_count_txn)
retval = {"users": users, "total": count}
@ -514,7 +514,7 @@ class DataStore(
table="users",
term=term,
col="name",
retcols=["name", "password_hash", "is_guest", "admin"],
retcols=["name", "password_hash", "is_guest", "admin", "user_type"],
desc="search_users",
)