def auth_required(realm, auth_func):
def auth_decorator(func):<EOL><INDENT>def inner(self, *args, **kw):<EOL><INDENT>if self.get_authenticated_user(auth_func, realm):<EOL><INDENT>return func(self, *args, **kw)<EOL><DEDENT><DEDENT>return inner<EOL><DEDENT>return auth_decorator<EOL>
Decorator that protect methods with HTTP authentication.