Re: [pylons-discuss] Check if a user can access a particular view

2019-02-21 Thread Mike Orr
I use 'request.has_permission' to determine which menu links and editing buttons to show. On Wed, Feb 20, 2019 at 9:36 AM Michael Merickel wrote: > > Just to expand on Theron's suggestion a bit more: there is not a general > solution to the problem because Pyramid's routing system is flexible

Re: [pylons-discuss] Check if a user can access a particular view

2019-02-21 Thread Thijs
Many thanks, I eventually found the has_permission and settled on using that. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [pylons-discuss] Check if a user can access a particular view

2019-02-20 Thread Michael Merickel
Just to expand on Theron's suggestion a bit more: there is not a general solution to the problem because Pyramid's routing system is flexible enough that it's not easy to tell which view will be invoked for a particular request without actually executing the request. If you know what permission

Re: [pylons-discuss] Check if a user can access a particular view

2019-02-20 Thread Theron Luhn
Check out request.has_permission: https://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request.has_permission — Theron > On Feb 20, 2019, at 3:10 AM, Thijs wrote: > > In a view I want to return a few hyperlinks to other views. However, I don't > want

[pylons-discuss] Check if a user can access a particular view

2019-02-20 Thread Thijs
In a view I want to return a few hyperlinks to other views. However, I don't want to present users with links to views they have no permission for. Is there any way to check if a user has access to a certain view so I can omit the links to denied views? -- You received this message because