-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
e0ba252
to
bdeb189
Compare
@@ -433,25 +433,3 @@ def snapshot_all_rooms( | |||
ret["membership"] = membership | |||
|
|||
return ret | |||
|
|||
async def _check_in_room_or_world_readable(self, room_id, user_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was an exact cut-and-paste of Auth.check_in_room_or_world_readable
; removed for sanity.
bdeb189
to
f7c6bec
Compare
@@ -662,7 +664,9 @@ def check_in_room_or_world_readable(self, room_id, user_id): | |||
): | |||
return Membership.JOIN, None | |||
raise AuthError( | |||
403, "Guest access not allowed", errcode=Codes.GUEST_ACCESS_FORBIDDEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was never anything to do with guest access, so the error message was wrong and confusing; I've fixed it up while I'm here.
@@ -633,10 +625,18 @@ def get_access_token_from_request(request): | |||
return query_params[0].decode("ascii") | |||
|
|||
@defer.inlineCallbacks | |||
def check_in_room_or_world_readable(self, room_id, user_id): | |||
def check_user_in_room_or_world_readable( | |||
self, room_id: str, user_id: str, allow_departed_users: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this defaults to False
for consistency with check_user_in_room
, and for safety (if you forget to set it, it's safer if we deny access to users that should have it than grant access to users that should).
these were getting a bit unwieldy, so let's combine `check_joined_room` and `check_user_was_in_room` into a single `check_user_in_room`.
f7c6bec
to
31e9e9e
Compare
... and set it everywhere it's called. while we're here, rename it for consistency with `check_user_in_room` (and to help check that I haven't missed any instances)
As per matrix-org/matrix-spec-proposals#2432 (review), make room alias lists accessible to users outside world_readable rooms.
31e9e9e
to
603618c
Compare
* commit '2fb7794e6': changelog Make room alias lists peekable Add `allow_departed_users` param to `check_in_room_or_world_readable` Refactor the membership check methods in Auth
As per matrix-org/matrix-spec-proposals#2432 (review), make room alias lists accessible to users outside world_readable rooms.
This also involves a bit of a refactor in
Auth
, in particular trying to avoid yet another method for checking user room membership, by combiningcheck_joined_room
andcheck_user_was_in_room
. The commits should stand alone and be independently reviewable.