[Zope3-dev] gadfly adapter configuration

Velko Ivanov dachev at nove.bg
Wed Sep 28 09:56:58 EDT 2005


Hello,

 > I tested gadly adapter then I got ForbiddenAttribute error.
 >
 > I think it may needs additional configuration to gadflyda.zcml.

If you are using the UI grant tool to specify permissions for your 
principal, the problem is that ZopeConnection and ZopeCursor are not 
locatable objects and access is uncoditionally denied.
There was a thread on that recently, plus a submission to the bug collector.

One possible workaround is to set ZopeConnection and ZopeCursor to the 
zope.Public permission in zope/app/rdb/configure.zcml, which is a 
potential security risk (not a big one - if you are carefull with the 
objects, which create and use connections and cursors, there is no 
danger), also you will need to change the gadfly configuration to 
require something different than 'like ZopeConnection' (the database 
adapter is locatable).
The other way around is to patch zope.app.rdb code, make IZopeConnection 
and IZopeCursor interfaces inherit ILocation, then provide proper 
__name__ and __parent__ attributes to ZopeConnection and ZopeCursor 
objects at creation time - this is enough to make them locatable.

The same may apply to Row and ResultSet helper classes too.

Regards,
Velko Ivanov


More information about the Zope3-dev mailing list