Factor out an "assert_requester_is_admin" function (#5120)

Rather than copying-and-pasting the same four lines hundreds of times
This commit is contained in:
Richard van der Hoff 2019-05-02 10:45:52 +01:00 committed by GitHub
parent 1df2f80367
commit 0836cbb9f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 76 deletions

View file

@ -556,7 +556,7 @@ class Auth(object):
""" Check if the given user is a local server admin.
Args:
user (str): mxid of user to check
user (UserID): user to check
Returns:
bool: True if the user is an admin