def rule_for(self, target_class):
def decorator(rule_class):<EOL><INDENT>self.add_rule(rule_class, target_class)<EOL>return rule_class<EOL><DEDENT>return decorator<EOL>
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.