[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/ replace a couple of removeAllProxies() calls with removeSecurityProxy()

Fred L. Drake, Jr. fdrake at gmail.com
Wed Aug 25 15:41:01 EDT 2004


Log message for revision 27270:
  replace a couple of removeAllProxies() calls with removeSecurityProxy()
  calls, making sure the comments make sense
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_factory.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/namespace.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_factory.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_factory.py	2004-08-25 19:29:34 UTC (rev 27269)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/component/tests/test_factory.py	2004-08-25 19:41:00 UTC (rev 27270)
@@ -21,7 +21,7 @@
 from zope.configuration.xmlconfig import xmlconfig
 from zope.configuration.xmlconfig import XMLConfig
 from zope.component import createObject
-from zope.proxy import removeAllProxies
+from zope.security.proxy import removeSecurityProxy
 from zope.app.tests.placelesssetup import PlacelessSetup
 
 from zope.app import zapi
@@ -64,7 +64,8 @@
 </content>''')
         xmlconfig(f)
         obj = createObject(None, 'test.Example')
-        obj = removeAllProxies(obj)
+        # isinstance() doesn't work with proxies, so remove if present
+        obj = removeSecurityProxy(obj)
         self.failUnless(isinstance(obj, ExampleClass))
 
 def test_suite():

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/namespace.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/namespace.py	2004-08-25 19:29:34 UTC (rev 27269)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/namespace.py	2004-08-25 19:41:00 UTC (rev 27270)
@@ -22,7 +22,7 @@
 from zope.exceptions import NotFoundError
 
 from zope.app.traversing.interfaces import ITraversable, IPathAdapter
-from zope.proxy import removeAllProxies
+from zope.security.proxy import removeSecurityProxy
 
 class UnexpectedParameters(NotFoundError):
     "Unexpected namespace parameters were provided."
@@ -163,9 +163,9 @@
     if resource is None:
         return default
 
-    # We need to set the __parent__ and __name__. We need the unproxied
-    # resource to do this.  we will still return the proxied resource.
-    r = removeAllProxies(resource)
+    # We need to set the __parent__ and __name__.  We need the unproxied
+    # resource to do this.  We still return the proxied resource.
+    r = removeSecurityProxy(resource)
 
     r.__parent__ = site
     r.__name__ = name



More information about the Zope3-Checkins mailing list