diff options
author | David Baker <dave@matrix.org> | 2018-10-09 10:05:02 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2018-10-09 10:05:02 +0100 |
commit | dc045ef20222bfbe8dcb5dae297e741509cce8d1 (patch) | |
tree | ee03ab45ce9791a06c12d15c01d3412cd101330a /synapse/event_auth.py | |
parent | Apparently this blank line is Very Important (diff) | |
parent | Merge pull request #4017 from matrix-org/rav/optimise_filter_events_for_server (diff) | |
download | synapse-dc045ef20222bfbe8dcb5dae297e741509cce8d1.tar.xz |
Merge remote-tracking branch 'origin/develop' into dbkr/e2e_backups
Diffstat (limited to 'synapse/event_auth.py')
-rw-r--r-- | synapse/event_auth.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/synapse/event_auth.py b/synapse/event_auth.py index 6baeccca38..af3eee95b9 100644 --- a/synapse/event_auth.py +++ b/synapse/event_auth.py @@ -98,9 +98,9 @@ def check(event, auth_events, do_sig_check=True, do_size_check=True): creation_event = auth_events.get((EventTypes.Create, ""), None) if not creation_event: - raise SynapseError( + raise AuthError( 403, - "Room %r does not exist" % (event.room_id,) + "No create event in auth events", ) creating_domain = get_domain_from_id(event.room_id) @@ -155,10 +155,7 @@ def check(event, auth_events, do_sig_check=True, do_size_check=True): if user_level < invite_level: raise AuthError( - 403, ( - "You cannot issue a third party invite for %s." % - (event.content.display_name,) - ) + 403, "You don't have permission to invite users", ) else: logger.debug("Allowing! %s", event) @@ -305,7 +302,7 @@ def _is_membership_change_allowed(event, auth_events): if user_level < invite_level: raise AuthError( - 403, "You cannot invite user %s." % target_user_id + 403, "You don't have permission to invite users", ) elif Membership.JOIN == membership: # Joins are valid iff caller == target and they were: |