3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

raw: fix permission check logic

This commit is contained in:
James Lu 2022-01-02 11:19:10 -08:00
parent 499a0dd403
commit 8c4efc030a

View File

@ -12,16 +12,12 @@ def raw(irc, source, args):
Sends raw text to the IRC server.
This command is not officially supported on non-Clientbot networks, where it
requires a separate permission."""
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):
Use with caution - This command is only officially supported on Clientbot networks."""
if not conf.conf['pylink'].get("raw_enabled", False):
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)
if not args.strip():