[Zope3-Users] Traverse to nearest site in menu action
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Apr 1 21:32:00 EST 2005
On Thursday 31 March 2005 09:23, Florian Lindner wrote:
> it works: When I'm calling
> http://horus.local:8080/++skin++centershock/cs/++site++ I see the contents
> of the root folder (my nearest site).
>
> Now I want to use for a menu item:
>
> <menuItems
> menu="CSnavMenu"
> for="*"
> layer="centershock">
>
> <menuItem
> title="home2"
> action="++site++" />
>
> </menuItems>
>
> Resulting in:
>
> File "/home/florian/Zope3/src/zope/app/publisher/browser/menu.py", line
> 180, in getMenu
> return menu.getMenuItems(object, request)
> File "/home/florian/Zope3/src/zope/app/publisher/browser/menu.py", line
> 55, in getMenuItems
> if item.available():
> File "/home/florian/Zope3/src/zope/app/publisher/browser/menu.py", line
> 123, in available
> if not canAccess(view, '__call__'):
> File "/home/florian/Zope3/src/zope/security/checker.py", line 114, in
> canAccess
> checker.check_getattr(obj, name)
> ForbiddenAttribute: ('__call__', <zope.app.folder.folder.Folder object at
> 0xb6ee2d6c>)
>
>
> How do I have to call it?
This is because the menu code makes the assumption that any view specified in
the action provides a '__call__' method. Clearly your custom namespace does
not. Maybe we should look for a different method that is always available.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
More information about the Zope3-users
mailing list