[Zope-CMF] Re: Unauthorized errors on macro access
Jens Vagelpohl
jens at dataflake.org
Mon Apr 3 09:59:58 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 3 Apr 2006, at 14:51, Tres Seaver wrote:
> I think it is actually blowing up trying to validate access to the
> 'macros' object from your view. I was able to work around that
> part by
> adding the following view class:
>
> - ---------------------- %< ------------------------------------
> from AccessControl.SecurityInfo import ClassSecurityInfo
> from Globals import InitializeClass
> from Products.Five.browser import BrowserView
>
> from Products.CMFCalendar.permissions import View
>
> class CalendarWidgetView(BrowserView):
> security = ClassSecurityInfo()
> security.declareProtected(View, 'macros')
> def _macros(self):
> return self.index.macros
> macros = property(_macros, None, None)
>
> InitializeClass(CalendarWidgetView)
> - ---------------------- %< ------------------------------------
You're right, I did not mention that. Thanks a lot, I'll try that
tonight! It simply had not occurred to me that security declarations
can be put into a view class, the samples in CMFDefault did not need
this.
Might be able to finally merge it all in after that. Yay.
jens
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFEMSpfRAx5nvEhZLIRAhhEAJ9MRMNWvoOYWpDAlcRKBiI98aLXCwCcCq8q
C3PpyXafRzCO9A+dFvXl/oY=
=b3gX
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list