[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container -
adding.py:1.43
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Feb 13 17:42:23 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv12306/src/zope/app/browser/container
Modified Files:
adding.py
Log Message:
This is a band-aid blessed by Jim. The true solution will be discussed on
the mailing list first, since it applies to all other components that can
have local and global implementations as well.
=== Zope3/src/zope/app/browser/container/adding.py 1.42 => 1.43 ===
--- Zope3/src/zope/app/browser/container/adding.py:1.42 Wed Feb 11 02:00:37 2004
+++ Zope3/src/zope/app/browser/container/adding.py Fri Feb 13 17:42:22 2004
@@ -151,9 +151,14 @@
if not self.contentName:
self.contentName = id
+ # XXX: If the factory wrapped by LocationProxy is already a Proxy,
+ # then ProxyFactory does not the right thing and the original's
+ # checker info gets lost. No factory that was registered via ZCML
+ # and was used via addMenuItem worked here. (SR)
factory = zapi.getFactory(self, type_name)
- factory = LocationProxy(factory, self, type_name)
- factory = zope.security.checker.ProxyFactory(factory)
+ if not type(factory) is zope.security.checker.Proxy:
+ factory = LocationProxy(factory, self, type_name)
+ factory = zope.security.checker.ProxyFactory(factory)
content = factory()
# Can't store security proxies.
More information about the Zope3-Checkins
mailing list