How to check what permission failed in authorization in pyramid (pylons 2)?

645 Views Asked by At

I add a view for the forbidden view:

from pyramid.exceptions import Forbidden
config.add_view(forbidden_view, context=Forbidden)

which redirects to a log in screen.

But now i added some admin things which needed admin access, and I want to just show a "you don't have the permission" screen, how do I check for that in the forbidden view?

1

There are 1 best solutions below

0
On BEST ANSWER

I'm afraid that information is lost when Pyramid raises a Forbidden error as the result of a permission denial. There's an item in the TODO.txt to carry it along through the Forbidden error.