def allows(self, user, permission, obj=_nothing):
rule = self._get_rule(obj)<EOL>if not isinstance(permission, basestring):<EOL><INDENT>return all(<EOL>self._use_rule(rule, user, perm, obj)<EOL>for perm in permission<EOL>)<EOL><DEDENT>return self._use_rule(rule, user, permission, obj)<EOL>
Checks that a user has permission. Returns True or False.

        :param user: a user.
        :param permission: permission to check.
        :param obj: (optional) an object to check permission for.