diff --git a/mautrix_telegram/commands/portal/config.py b/mautrix_telegram/commands/portal/config.py index f8e9c2e5..0479938b 100644 --- a/mautrix_telegram/commands/portal/config.py +++ b/mautrix_telegram/commands/portal/config.py @@ -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":