mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-20 07:20:59 +01:00
raw: fix permission check logic
This commit is contained in:
parent
499a0dd403
commit
8c4efc030a
@ -12,16 +12,12 @@ def raw(irc, source, args):
|
|||||||
|
|
||||||
Sends raw text to the IRC server.
|
Sends raw text to the IRC server.
|
||||||
|
|
||||||
This command is not officially supported on non-Clientbot networks, where it
|
Use with caution - This command is only officially supported on Clientbot networks."""
|
||||||
requires a separate permission."""
|
if not conf.conf['pylink'].get("raw_enabled", False):
|
||||||
|
|
||||||
if irc.protoname == 'clientbot':
|
|
||||||
# exec.raw is included for backwards compatibility with PyLink 1.x
|
|
||||||
perms = ['raw.raw', 'exec.raw']
|
|
||||||
elif not conf.conf['pylink'].get("raw_enabled", False):
|
|
||||||
raise RuntimeError("Raw commands are not supported on this protocol")
|
raise RuntimeError("Raw commands are not supported on this protocol")
|
||||||
|
|
||||||
permissions.check_permissions(irc, source, perms)
|
# exec.raw is included for backwards compatibility with PyLink 1.x
|
||||||
|
permissions.check_permissions(irc, source, ['raw.raw', 'exec.raw'])
|
||||||
|
|
||||||
args = ' '.join(args)
|
args = ' '.join(args)
|
||||||
if not args.strip():
|
if not args.strip():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user