Decorates and adds an authorization rule
        for a specified class(es) of objects.

        :param target_class: a class or an iterable with classes
            to associate the rule with.

def rule_for(self, target_class):
        """Decorates and adds an authorization rule
        for a specified class(es) of objects.

        :param target_class: a class or an iterable with classes
            to associate the rule with.
        """
        def decorator(rule_class):
            self.add_rule(rule_class, target_class)
            return rule_class
        return decorator