Adds an authorization rule.

        :param rule_class: a class of authorization rule.
        :param target_class: (optional) a class
            or an iterable with classes to associate the rule with.

def add_rule(self, rule_class, target_class=_Nothing):
        """Adds an authorization rule.

        :param rule_class: a class of authorization rule.
        :param target_class: (optional) a class
            or an iterable with classes to associate the rule with.
        """
        if isinstance(target_class, Iterable):
            for cls in target_class:
                self._rules[cls] = rule_class
        else:
            self._rules[target_class] = rule_class