code: def allows(self, user, permission, obj=_nothing):
          
          rule = self._get_rule(obj)
  
          if not isinstance(permission, basestring):
              return all(
                  self._use_rule(rule, user, perm, obj)
                  for perm in permission
              )
  
          return self._use_rule(rule, user, permission, obj)
docs: 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.