diff --git a/plugins/opercmds.py b/plugins/opercmds.py index f25ea84..23033a0 100644 --- a/plugins/opercmds.py +++ b/plugins/opercmds.py @@ -3,13 +3,14 @@ opercmds.py: Provides a subset of network management commands. """ from pylinkirc import utils from pylinkirc.log import log +from pylinkirc.coremods import permissions @utils.add_cmd def checkban(irc, source, args): """ [] Oper only. If a nick or hostmask is given, return whether the given banmask will match it. Otherwise, returns a list of connected users that would be affected by such a ban, up to 50 results.""" - irc.checkAuthenticated(source) + permissions.checkPermissions(irc, source, ['opercmds.checkban']) try: banmask = args[0] @@ -55,7 +56,7 @@ def jupe(irc, source, args): Admin only, jupes the given server.""" # Check that the caller is either opered or logged in as admin. - irc.checkAuthenticated(source, allowOper=False) + permissions.checkPermissions(irc, source, ['opercmds.jupe']) try: servername = args[0] @@ -82,7 +83,7 @@ def kick(irc, source, args): """ [] Admin only. Kicks from via , where is either the nick of a PyLink client or the SID of a PyLink server.""" - irc.checkAuthenticated(source, allowOper=False) + permissions.checkPermissions(irc, source, ['opercmds.kick']) try: sourcenick = args[0] channel = irc.toLower(args[1]) @@ -123,7 +124,7 @@ def kill(irc, source, args): """ [] Admin only. Kills via , where is either the nick of a PyLink client or the SID of a PyLink server.""" - irc.checkAuthenticated(source, allowOper=False) + permissions.checkPermissions(irc, source, ['opercmds.kill']) try: sourcenick = args[0] target = args[1] @@ -166,7 +167,7 @@ def mode(irc, source, args): Oper-only, sets modes on the target channel.""" # Check that the caller is either opered or logged in as admin. - irc.checkAuthenticated(source) + permissions.checkPermissions(irc, source, ['opercmds.mode']) try: target, modes = args[0], args[1:] @@ -204,7 +205,7 @@ def topic(irc, source, args): """ Admin only. Updates the topic in a channel.""" - irc.checkAuthenticated(source, allowOper=False) + permissions.checkPermissions(irc, source, ['opercmds.topic']) try: channel = args[0] topic = ' '.join(args[1:])