Pyramid handlers: authorization for entire handler action

50 views
Skip to first unread message

walden

unread,
Aug 14, 2011, 11:29:05 PM8/14/11
to pylons-discuss
So I have a pyramid handler where the entire handler requires
authorization. I've followed the guide here:
http://sluggo.scrapping.cc/python/Akhet/auth.html.

But instead of doing:

@action(permission='authenticated')
def some_method(self):
....

For each action in my handler, is there a way to tell Pyramid that the
entire handler requires the authenticated permission?

Thanks,
Walden

Wyatt Baldwin

unread,
Aug 15, 2011, 12:20:45 AM8/15/11
to pylons-...@googlegroups.com
As of pyramid_handlers 0.2, you should be able to set the default permission for a handler like this:

    config.add_handler(..., view_permission='authenticated')

walden

unread,
Aug 15, 2011, 9:03:33 PM8/15/11
to pylons-discuss
Awesome, thank you so much.

Cheers,
Walden


On Aug 15, 12:20 am, Wyatt Baldwin <wyatt.lee.bald...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages