update other modules to use categorised require_access

This commit is contained in:
jesopo 2020-02-07 00:11:28 +00:00
parent fe1c9ef746
commit d588760fc4
7 changed files with 11 additions and 12 deletions

View file

@ -200,7 +200,7 @@ class Module(ModuleManager.BaseModule):
"""
:help: Add/remove/modify a git webhook
:require_mode: high
:require_access: git-webhook
:require_access: admin,git-webhook
:permission: gitoverride
:usage: list
:usage: add <hook>

View file

@ -85,7 +85,7 @@ class Module(ModuleManager.BaseModule):
if event["target"].get_setting("votes-start-restricted", True):
event["check_assert"](utils.Check("channel-mode", "o")|
utils.Check("permission", "vote")|
utils.Check("channel-access", "vote"))
utils.Check("channel-access", "low,vote"))
vote = self._start_vote(event["target"], event["args"])
event["stdout"].write(
@ -99,7 +99,7 @@ class Module(ModuleManager.BaseModule):
:help: End a vote
:usage: <id>
:require_mode: o
:require_access: vote
:require_access: high,vote
:permission: vote
"""
vote_id = event["args_split"][0]
@ -117,10 +117,10 @@ class Module(ModuleManager.BaseModule):
:help: Cast choice for a given vote
:usage: <id> [choice]
"""
if event["target"].get_setting("votes-scast-restricted", True):
if event["target"].get_setting("votes-cast-restricted", True):
event["check_assert"](utils.Check("channel-mode", "v")|
utils.Check("permission", "vote")|
utils.Check("channel-access", "vote"))
utils.Check("channel-access", "low,vote"))
vote_id = event["args_split"][0]
vote = self._get_vote(event["target"], vote_id)

View file

@ -43,7 +43,7 @@ class Module(ModuleManager.BaseModule):
elif event["is_channel"]:
target = event["target"].name
check |= utils.Check("channel-mode", "high")
check |= utils.Check("channel-access", "part")
check |= utils.Check("channel-access", "high,part")
else:
event["stderr"].write("No channel provided")

View file

@ -54,8 +54,7 @@ class Module(ModuleManager.BaseModule):
@utils.hook("received.command.balias",
permission="balias")
@utils.hook("received.command.calias",
require_mode="o", require_access="alias")
require_mode="o", require_access="high,alias")
@utils.spec("!'list ?<alias>wordlower")
@utils.spec("!'add !<alias>wordlower !<command>wordlower ?<args>string")
@utils.spec("!'remove !<alias>wordlower")

View file

@ -199,7 +199,7 @@ class Module(ModuleManager.BaseModule):
"Cannot change config for current channel when in "
"private message")
event["check_assert"](permission_check|
utils.Check("channel-access", target, "config")|
utils.Check("channel-access", target, "high,config")|
utils.Check("channel-mode", target, "o"))
elif context == "serverset" or context == "botset":
event["check_assert"](permission_check)

View file

@ -103,7 +103,7 @@ class Module(ModuleManager.BaseModule):
@utils.kwarg("usage", "<nickname>")
@utils.kwarg("permission", "cignore")
@utils.kwarg("require_mode", "o")
@utils.kwarg("require_access", "cignore")
@utils.kwarg("require_access", "high,cignore")
def cignore(self, event):
remove = event["command"] == "cunignore"

View file

@ -25,7 +25,7 @@ class Module(ModuleManager.BaseModule):
"(default: 5 minutes)")
@utils.kwarg("usage", "[+time]")
@utils.kwarg("require_mode", "high")
@utils.kwarg("require_access", "silence")
@utils.kwarg("require_access", "low,silence")
@utils.kwarg("permission", "silence")
def silence(self, event):
duration = SILENCE_TIME
@ -44,7 +44,7 @@ class Module(ModuleManager.BaseModule):
@utils.kwarg("unsilence", True)
@utils.kwarg("channel_only", True)
@utils.kwarg("require_mode", "high")
@utils.kwarg("require_access", "unsilence")
@utils.kwarg("require_access", "low,unsilence")
@utils.kwarg("permission", "unsilence")
def unsiltence(self, event):
silence_until = event["target"].get_setting("silence-until", None)