summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-12-16 08:46:37 -0500
committerGitHub <noreply@github.com>2020-12-16 08:46:37 -0500
commitbe2db93b3c14396d53d30f8d5f92db014453487b (patch)
tree45d487763583c8791da8f62f9e9949f72ee21edb /synapse/api/auth.py
parentPreparatory refactoring of the SamlHandlerTestCase (#8938) (diff)
downloadsynapse-be2db93b3c14396d53d30f8d5f92db014453487b.tar.xz
Do not assume that the contents dictionary includes history_visibility. (#8945)
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 1951f6e178..48c4d7b0be 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -23,7 +23,7 @@ from twisted.web.server import Request
 import synapse.types
 from synapse import event_auth
 from synapse.api.auth_blocking import AuthBlocking
-from synapse.api.constants import EventTypes, Membership
+from synapse.api.constants import EventTypes, HistoryVisibility, Membership
 from synapse.api.errors import (
     AuthError,
     Codes,
@@ -648,7 +648,8 @@ class Auth:
             )
             if (
                 visibility
-                and visibility.content["history_visibility"] == "world_readable"
+                and visibility.content.get("history_visibility")
+                == HistoryVisibility.WORLD_READABLE
             ):
                 return Membership.JOIN, None
             raise AuthError(