Merge pull request #251 from matrix-org/removeadmin
Stop looking up "admin", which we never read
2 files changed, 3 insertions, 6 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index b41e34e658..65ee1452ce 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -392,8 +392,7 @@ class Auth(object):
Args:
token (str): The access token to get the user by.
Returns:
- dict : dict that includes the user and whether the
- user is a server admin.
+ dict : dict that includes the user and the ID of their access token.
Raises:
AuthError if no user by that token exists or the token is invalid.
"""
@@ -404,7 +403,6 @@ class Auth(object):
errcode=Codes.UNKNOWN_TOKEN
)
user_info = {
- "admin": bool(ret.get("admin", False)),
"user": UserID.from_string(ret.get("name")),
"token_id": ret.get("token_id", None),
}
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index 240d14c4d0..a2d0f7c4b1 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -163,8 +163,7 @@ class RegistrationStore(SQLBaseStore):
Args:
token (str): The access token of a user.
Returns:
- dict: Including the name (user_id) and whether they are
- an admin.
+ dict: Including the name (user_id) and the ID of their access token.
Raises:
StoreError if no user was found.
"""
@@ -228,7 +227,7 @@ class RegistrationStore(SQLBaseStore):
def _query_for_auth(self, txn, token):
sql = (
- "SELECT users.name, users.admin, access_tokens.id as token_id"
+ "SELECT users.name, access_tokens.id as token_id"
" FROM users"
" INNER JOIN access_tokens on users.name = access_tokens.user_id"
" WHERE token = ?"
|