1066929: authenticated_plus decorator

Added 6 years ago by Peter Bengtsson


1 Add your love!



The default authenticated decorator that comes with tornado is great but in my app I have to make a difference between logged in users and logged in users. Example use:

class SomeHandler(RequestHandler):

    @authenticated_plus(lambda user: user.is_active())
    def get(self):

I hate how this code repeats the code of tornado.web.authenticated because it means I'd have to maintain my code when the tornado one changes. Ideas for a patch to tornado to make this more modular is welcome!

File: gistfile1.py