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 v开发者_Python百科iew?
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.
精彩评论