AW: [Zope3-Users] How to check access on a view?
Hermann Himmelbauer
dusty at qwer.tk
Mon Feb 18 04:41:34 EST 2008
Am Sonntag, 17. Februar 2008 12:41 schrieb Roger Ineichen:
> 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').
Yes, many thanks, this did the trick!
Best Regards,
Hermann
--
hermann at qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7
More information about the Zope3-users
mailing list