mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Changed addcapability to reject all attempts to add the owner capability.
This commit is contained in:
parent
66061f6a34
commit
e48569b64a
@ -139,8 +139,13 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
Gives the user specified by <name> (or the user to whom <hostmask>
|
Gives the user specified by <name> (or the user to whom <hostmask>
|
||||||
currently maps) the specified capability <capability>
|
currently maps) the specified capability <capability>
|
||||||
"""
|
"""
|
||||||
(name, capability) = privmsgs.getArgs(args, 2)
|
(name, capability) = privmsgs.getArgs(args, required=2)
|
||||||
# This next check to make sure 'admin's can't hand out 'owner'.
|
if capability == 'owner':
|
||||||
|
irc.error(msg, 'The "owner" capability can\'t be added in the bot.'
|
||||||
|
' Use the supybot-adduser program (or edit the '
|
||||||
|
'users.conf file yourself) to add an owner '
|
||||||
|
'capability.')
|
||||||
|
return
|
||||||
if ircdb.checkCapability(msg.prefix, capability) or \
|
if ircdb.checkCapability(msg.prefix, capability) or \
|
||||||
'!' in capability:
|
'!' in capability:
|
||||||
try:
|
try:
|
||||||
|
@ -118,6 +118,9 @@ class AdminTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
self.assertEqual(m.command, 'NICK')
|
self.assertEqual(m.command, 'NICK')
|
||||||
self.assertEqual(m.args[0], 'foobar')
|
self.assertEqual(m.args[0], 'foobar')
|
||||||
|
|
||||||
|
def testAddCapabilityOwner(self):
|
||||||
|
self.assertError('admin addcapability %s owner' % self.nick)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
Loading…
Reference in New Issue
Block a user