Skip to content

Commit 538f463

Browse files
committed
[maybe] Allow system admins to bypass all other checks
1 parent fa8d5ed commit 538f463

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

synapse/media/media_repository.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,11 @@ async def is_media_visible(
367367
raise NotFoundError()
368368

369369
# Which means a bypass was requested
370-
if not redacted_media_bypass_config.is_admin:
370+
if redacted_media_bypass_config.is_admin:
371+
# System admins get to bypass the rest of the checks
372+
return
373+
else:
374+
# Not an admin, let's check they have a high enough power level.
371375
# Lifted this directly from RoomEventServlet for msc2815
372376
auth_events = (
373377
await self._storage_controllers.state.get_current_state(

0 commit comments

Comments
 (0)