Allow MSC3030 'timestamp_to_event' calls from anyone on world-readable rooms. (#13062)

Signed-off-by: Quentin Gliech <quenting@element.io>
pull/13098/head
Quentin Gliech 2022-06-17 12:39:26 +02:00 committed by GitHub
parent 9372f6f842
commit c6d6176411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

1
changelog.d/13062.misc Normal file
View File

@ -0,0 +1 @@
Allow MSC3030 'timestamp_to_event' calls from anyone on world-readable rooms.

View File

@ -1177,7 +1177,9 @@ class TimestampLookupRestServlet(RestServlet):
self, request: SynapseRequest, room_id: str
) -> Tuple[int, JsonDict]:
requester = await self._auth.get_user_by_req(request)
await self._auth.check_user_in_room(room_id, requester.user.to_string())
await self._auth.check_user_in_room_or_world_readable(
room_id, requester.user.to_string()
)
timestamp = parse_integer(request, "ts", required=True)
direction = parse_string(request, "dir", default="f", allowed_values=["f", "b"])