3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-26 02:10:39 +01:00

changehost: limit 'applyhosts' to those with the changehost.applyhosts perm

(cherry picked from commit 12a85092990743d46808544e35a787e5e048ab8c)
This commit is contained in:
James Lu 2016-12-09 22:07:27 -08:00
parent 194a62fcea
commit 3595e5fdbf

View File

@ -3,6 +3,7 @@ Changehost plugin - automatically changes the hostname of matching users.
""" """
from pylinkirc import utils, world, conf from pylinkirc import utils, world, conf
from pylinkirc.log import log from pylinkirc.log import log
from pylinkirc.coremods import permissions
import string import string
@ -87,6 +88,8 @@ def applyhosts(irc, sender, args):
Applies all configured hosts for users on the given network, or the current network if none is specified.""" Applies all configured hosts for users on the given network, or the current network if none is specified."""
permissions.checkPermissions(irc, sender, ['changehost.applyhosts'])
try: # Try to get network from the command line. try: # Try to get network from the command line.
network = world.networkobjects[args[0]] network = world.networkobjects[args[0]]
except IndexError: # No network was given except IndexError: # No network was given