diff options
| author | 2019-06-14 12:09:42 +0100 | |
|---|---|---|
| committer | 2019-06-14 12:09:42 +0100 | |
| commit | f614d1fc1480724b2d5f2cb409ad8a1962173b74 (patch) | |
| tree | 3123b15da131a473532c063914e807edfca34c96 /modules/config.py | |
| parent | Add a way to __or__ `utils.Check`s, as a "if one of these passes" thing (diff) | |
| signature | ||
add `self` check.command, change !config to use new yields
Diffstat (limited to 'modules/config.py')
| -rw-r--r-- | modules/config.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/config.py b/modules/config.py index a6d06f3f..ba02f308 100644 --- a/modules/config.py +++ b/modules/config.py @@ -281,7 +281,6 @@ class Module(ModuleManager.BaseModule): """ :help: Change config options :usage: <context>[:name] [-][setting [value]] - :permission: config """ arg_count = len(event["args_split"]) @@ -297,12 +296,17 @@ class Module(ModuleManager.BaseModule): target, context = self._to_context(event["server"], event["target"], event["user"], context_desc) + permission_check = utils.Check("permission", "config") + if context == "set": if name: + yield utils.Check("self", name)|permission_check target = event["server"].get_user(name) else: target = event["user"] elif context == "channelset": + yield utils.Check("channel-mode", "o")|permission_check + if name: if name in event["server"].channels: target = event["server"].channels.get(name) @@ -316,6 +320,8 @@ class Module(ModuleManager.BaseModule): raise utils.EventError( "Cannot change config for current channel when in " "private message") + elif context == "serverset" or context == "botset": + yield utils.Check("permission", "config") export_settings = self._get_export_setting(context) if not setting == None: |
