diff --git a/plugins/sieve.py b/plugins/sieve.py index 108390e..542d0a9 100644 --- a/plugins/sieve.py +++ b/plugins/sieve.py @@ -22,8 +22,10 @@ def sieve_suite(bot, input, func, kind, args): if fn and fn.group(1).lower() in disabled: return None - acl = bot.config.get('acls', {}).get(func.__name__) - if acl: + acls = bot.config.get('acls', {}) + for acl in [acls.get(func.__name__), acls.get(input.chan), acls.get(input.conn.server)]: + if acl is None: + continue if 'deny-except' in acl: allowed_channels = map(unicode.lower, acl['deny-except']) if input.chan.lower() not in allowed_channels: @@ -32,6 +34,12 @@ def sieve_suite(bot, input, func, kind, args): denied_channels = map(unicode.lower, acl['allow-except']) if input.chan.lower() in denied_channels: return None + if 'whitelist' in acl: + if func.__name__ not in acl['whitelist']: + return None + if 'blacklist' in acl: + if func.__name__ in acl['whitelist']: + return None if args.get('adminonly', False): admins = bot.config.get('admins', [])