Merge pull request #122 from correl/acl_check_fix

XEP-0009: ACL.check fix
This commit is contained in:
Lance Stout 2011-12-15 16:14:29 -08:00
commit a67e16d1b7

View file

@ -113,6 +113,9 @@ class ACL:
def check(cls, rules, jid, resource): def check(cls, rules, jid, resource):
if rules is None: if rules is None:
return cls.DENY # No rules means no access! return cls.DENY # No rules means no access!
jid = str(jid) # Check the string representation of the JID.
if not jid:
return cls.DENY # Can't check an empty JID.
for rule in rules: for rule in rules:
policy = cls._check(rule, jid, resource) policy = cls._check(rule, jid, resource)
if policy is not None: if policy is not None: