Third party event rules Update (#6781)

This commit is contained in:
PeerD 2020-02-06 15:15:29 +01:00 committed by GitHub
parent ed630ea17c
commit 99fcc96289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -579,9 +579,13 @@ class RoomCreationHandler(BaseHandler):
# Check whether the third party rules allows/changes the room create
# request.
yield self.third_party_event_rules.on_create_room(
event_allowed = yield self.third_party_event_rules.on_create_room(
requester, config, is_requester_admin=is_requester_admin
)
if not event_allowed:
raise SynapseError(
403, "You are not permitted to create rooms", Codes.FORBIDDEN
)
if not is_requester_admin and not self.spam_checker.user_may_create_room(
user_id