views:

101

answers:

1

I'd like to write a simple decorator that I can put above functions in my controller to check authentication and re-direct to the login page if the current user is not authenticated. What is the best way to do this? Where should the decorator go? How should I pass cookie info to the decorator? Sample code is greatly appreciated.

Thank you!

+1  A: 

Another approach for authorization in pylons (decorator based, repoze.what like)

How should I pass cookie info to the decorator?

Use a global request object and get cookie or use wsgi environ of the request

estin