Fixed Issue 93: ACL.check jid parameter should be a string value

This commit is contained in:
Correl Roush 2011-12-15 21:58:33 +00:00
parent d496417deb
commit c98a22e065

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: