Allow room moderators to set room-specific configs

This commit is contained in:
Tulir Asokan
2019-11-30 21:38:33 +02:00
parent 701b28c33c
commit 7d5e307368
+5 -1
View File
@@ -23,7 +23,7 @@ from ... import portal as po, util
from .. import command_handler, CommandEvent, SECTION_PORTAL_MANAGEMENT
@command_handler(help_section=SECTION_PORTAL_MANAGEMENT,
@command_handler(needs_auth=False, help_section=SECTION_PORTAL_MANAGEMENT,
help_text="View or change per-portal settings.",
help_args="<`help`|_subcommand_> [...]")
async def config(evt: CommandEvent) -> None:
@@ -43,6 +43,10 @@ async def config(evt: CommandEvent) -> None:
await config_view(evt, portal)
return
if not await portal.can_user_perform(evt.sender, "config"):
await evt.reply("You do not have the permissions to configure this room.")
return
key = evt.args[1] if len(evt.args) > 1 else None
value = yaml.load(" ".join(evt.args[2:])) if len(evt.args) > 2 else None
if cmd == "set":