Add a config option to block all room invites (#2457)

- allows sysadmins the ability to lock down their servers so that people can't
send their users room invites.
This commit is contained in:
Richard van der Hoff 2017-09-19 16:08:14 +01:00 committed by GitHub
parent 2eabdf3f98
commit aa620d09a0
5 changed files with 44 additions and 0 deletions

View file

@ -519,6 +519,14 @@ class Auth(object):
)
def is_server_admin(self, user):
""" Check if the given user is a local server admin.
Args:
user (str): mxid of user to check
Returns:
bool: True if the user is an admin
"""
return self.store.is_server_admin(user)
@defer.inlineCallbacks