Allow room moderators to set room-specific configs
This commit is contained in:
@@ -23,7 +23,7 @@ from ... import portal as po, util
|
|||||||
from .. import command_handler, CommandEvent, SECTION_PORTAL_MANAGEMENT
|
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_text="View or change per-portal settings.",
|
||||||
help_args="<`help`|_subcommand_> [...]")
|
help_args="<`help`|_subcommand_> [...]")
|
||||||
async def config(evt: CommandEvent) -> None:
|
async def config(evt: CommandEvent) -> None:
|
||||||
@@ -43,6 +43,10 @@ async def config(evt: CommandEvent) -> None:
|
|||||||
await config_view(evt, portal)
|
await config_view(evt, portal)
|
||||||
return
|
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
|
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
|
value = yaml.load(" ".join(evt.args[2:])) if len(evt.args) > 2 else None
|
||||||
if cmd == "set":
|
if cmd == "set":
|
||||||
|
|||||||
Reference in New Issue
Block a user