Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

handlers/room_member: fix guest access check when joining rooms #1772

Merged
merged 1 commit into from
Jan 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,12 @@ def _update_membership(
is_host_in_room = yield self._is_host_in_room(current_state_ids)

if effective_membership_state == Membership.JOIN:
if requester.is_guest and not self._can_guest_join(current_state_ids):
# This should be an auth check, but guests are a local concept,
# so don't really fit into the general auth process.
raise AuthError(403, "Guest access not allowed")
if requester.is_guest:
guest_can_join = yield self._can_guest_join(current_state_ids)
if not guest_can_join:
# This should be an auth check, but guests are a local concept,
# so don't really fit into the general auth process.
raise AuthError(403, "Guest access not allowed")

if not is_host_in_room:
inviter = yield self.get_inviter(target.to_string(), room_id)
Expand Down