[Zope-CMF] Unauthorized errors on macro access

Jens Vagelpohl jens at dataflake.org
Sun Apr 2 08:30:11 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just about done with the Fiveification of CMFCalendar, there's just  
one issue with the calendar box. I keep getting Unauthorized  
exceptions when trying to get to the macro for the box from the main  
template.

In main_template I put the following (this is just for testing and  
won't go into 2.0):

      <div metal:use-macro="context/@@calendar_widget/calendarBox">
       <!-- CMFCalendar not Installed -->
      </div>

The calendar_widget view is declared in CMFCalendar/browser/ 
configure.zcml:

   <browser:page
       for="*"
       name="calendar_widget"
       class=".calendar.CalendarView"
       template="templates/calendar_widgets.pt"
       permission="zope2.View"
       layer="cmf"
       />

calendar_widgets.pt declares the calendarBox macro, that stuff is  
just copied and pasted from the old calendarBox.pt.

Whenever the main_template renders, I get Unauthorized errors ending  
in this:

   File "/usr/local/zope/opt/Zope-2.9-branch/lib/python/Products/ 
PageTemplates/Expressions.py", line 127, in _eval
     ob = restrictedTraverse(ob, path, getSecurityManager())
   File "/usr/local/zope/opt/Zope-2.9-branch/lib/python/Products/ 
PageTemplates/Expressions.py", line 326, in restrictedTraverse
     if not validate(object, object, None, o):
   File "/usr/local/zope/opt/Zope-2.9-branch/lib/python/AccessControl/ 
ImplPython.py", line 564, in validate
     self._context)
   File "/usr/local/zope/opt/Zope-2.9-branch/lib/python/AccessControl/ 
ImplPython.py", line 334, in validate
     accessed, container, name, value, context)
   File "/usr/local/zope/opt/Zope-2.9-branch/lib/python/AccessControl/ 
ImplPython.py", line 809, in raiseVerbose
     raise Unauthorized(text)
Unauthorized: The container has no security assertions.  Access to  
None of (Products.Five.metaclass.SimpleViewClass from /usr/local/zope/ 
CMF20Instance/Products/CMFCalendar/browser/templates/ 
calendar_widgets.pt object at 0x3527dd0) denied.

Stepping through the code tells me that it barfs when trying to  
access the name "calendarBox" from this instance:  
<Products.Five.metaclass.SimpleViewClass from /usr/local/zope/ 
CMF20Instance/Products/CMFCalendar/browser/templates/ 
calendar_widgets.pt object at 0x3527dd0>.

Does anyone know what to do here?

jens

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEL8PURAx5nvEhZLIRAsNPAJ9CHbi7CM3CLeVgI3MZRyY+mqoC6wCfQI3H
S3/dpOa6e/GzVcbV6nSJBTs=
=4E5e
-----END PGP SIGNATURE-----


More information about the Zope-CMF mailing list