[Zope3-Users] Re: Traverse to nearest site in menu action

Florian Lindner mailinglists at xgm.de
Fri Apr 1 11:34:21 EST 2005


Am Donnerstag, 31. März 2005 13:58 schrieb Florian Lindner:
> Am Donnerstag, 31. März 2005 13:00 schrieb jürgen Kartnaller:
> > Florian Lindner wrote:
> > > Hello,
> > > I implemented to traverser to the nearest site using the code in the
> > > posting:
> > >
> > > [Zope3-Users] Re: Traversing to nearest site
> > > Von: jürgen Kartnaller <j.kartnaller at cable.vol.at>
> > > An: zope3-users at zope.org
> > > Datum: 17.03.2005 13:53
> > >
> > > 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?
> >
> > I do the same without problems.
> > Is your folder configuration correct (ZCML, interface, implementation) ?

It works now. I needed to add a permission attribute to the menuItem 
subdirective.
But why? I'm logged in as a zope,Manager and therefor I should have rights to 
see the site.

Another problem I have, that when I've clicked on home a few times you have a 
URL like that:

http://horus.local:8080/++skin++centershock/cs/++site++/++site++/++site++/++site++/++site++

Which in IMO is not so great. Any way to normalize this path?

Florian


More information about the Zope3-users mailing list