mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 11:42:51 +01:00
permissions: limit "login = admin access" to old-style (< 1.1) login blocks
This commit is contained in:
parent
506467193e
commit
57aa844fcb
@ -58,9 +58,11 @@ def checkPermissions(irc, uid, perms, also_show=[]):
|
|||||||
Checks permissions of the caller. If the caller has any of the permissions listed in perms,
|
Checks permissions of the caller. If the caller has any of the permissions listed in perms,
|
||||||
this function returns True. Otherwise, NotAuthorizedError is raised.
|
this function returns True. Otherwise, NotAuthorizedError is raised.
|
||||||
"""
|
"""
|
||||||
|
# For old (< 1.1 login blocks):
|
||||||
# If the user is logged in, they automatically have all permissions.
|
# If the user is logged in, they automatically have all permissions.
|
||||||
if irc.matchHost('$pylinkacc', uid):
|
if irc.matchHost('$pylinkacc', uid) and conf.conf['login'].get('user'):
|
||||||
log.debug('permissions: overriding permissions check for admin user %s', irc.getHostmask(uid))
|
log.debug('permissions: overriding permissions check for old-style admin user %s',
|
||||||
|
irc.getHostmask(uid))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Iterate over all hostmask->permission list mappings.
|
# Iterate over all hostmask->permission list mappings.
|
||||||
|
Loading…
Reference in New Issue
Block a user