开发者

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

开发者 https://www.devze.com 2023-02-08 17:28 出处:网络
I add a view for the forbidden view: from pyramid.exceptions import Forbidden config.add_view(forbidden_view, context=Forbidden)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号