On Feb 6, 5:53 pm, Timmy <[email protected]> wrote: > 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 thepermission" screen, how do I > check for that in the forbidden view?
Hi Timmy, I'm also trying to retrieve the permission of the original view after it is blocked by a forbidden exception so that I can tell the user why the user can't see the page. The closest code that I can find is in pyramid.security.view_execution_permitted(request.context, request, viewName) but it does not return the original view's permissions and route names don't seem to be compatible with view names. I think I'm near to finding a solution, though. RHH -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
