Hi Hermann > Betreff: Re: [Zope3-Users] How to check access on a view?
[...] > > Hi, > > For a simple menu, I need to check if the current principal has > > permissions to access a view. I understand that I can use the > > canAccess()/canWrite() function on object attributes but > how could I > > do this for views? import zope.security zope.security.canAccess(myView, '__call__') should work. Or if the view provides a render method, you can check zope.security.canAccess(myView, 'render'). See zope.viewlet, there we use this pattern in the viewlet manager zope.viewlet.manager line 85. Regards Roger Ineichen > > Best Regards, > > Hermann _______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users