Skip to content

Commit

Permalink
Ignore rules if the invited user is in the bypass list or an admin
Browse files Browse the repository at this point in the history
  • Loading branch information
MatMaul committed Jul 4, 2024
1 parent 66e3a94 commit ecd02e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions room_access_rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,14 @@ async def _on_membership_or_invite(
if await self._user_can_bypass_rules(previous_membership.sender):
return True

# Let's ignore rules if the invited user is in the bypass list or an admin
if (
event.type == EventTypes.Member
and event.membership == Membership.INVITE
and await self._user_can_bypass_rules(event.state_key)
):
return True

if rule == AccessRules.RESTRICTED:
ret = self._on_membership_or_invite_restricted(event)
elif rule == AccessRules.UNRESTRICTED:
Expand Down

0 comments on commit ecd02e9

Please sign in to comment.