[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - ZopePublication.py:1.1.2.25

Jim Fulton jim@zope.com
Sun, 3 Feb 2002 18:32:22 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv30347

Modified Files:
      Tag: Zope-3x-branch
	ZopePublication.py 
Log Message:
Moved the responsability for initially creating a Zope application
object from ZopePublication to the Zope main program, currently z3.py.

Cleaned up the default traversal method:
  - Only wrap and check security of new object if different.
  - do unnamed security check.


=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.1.2.24 => 1.1.2.25 ===
     version_cookie = 'Zope-Version'
     root_name = 'Application'
-    root_class = RootFolder
 
     def __init__(self, db):
         # db is a ZODB.DB.DB object.
@@ -82,12 +81,9 @@
 
         root = conn.root()
         app = root.get(self.root_name, None)
+        
         if app is None:
-            app = self.root_class()
-            root[self.root_name] = app
-
-        if hasattr(app, '__of__'):
-            app = app.__of__(RequestContainer(request))
+            raise SystemError, "Zope Application Not Found"
 
         return app
 
@@ -188,6 +184,9 @@
         return wrapped
 
     def getDefaultTraversal(self, request, ob):
+
+        r = ()
+
         if IBrowserPublisher.isImplementedBy(ob):
             r = ob.browser_default(request)
         else:
@@ -197,10 +196,9 @@
             else:
                 return (ob, None)
 
-        # the following may need to be fixed, as this component
-        # does assert a name, though we have no way of
-        # getting it here - chrism
-        name = ''
-        wrapped = wrapper.Wrapper(r[0], ob, name=name)
-        getSecurityManager().validate(name, wrapped)
+        if r[0] is ob: return r
+        
+        wrapped = wrapper.Wrapper(r[0], ob, name=None)
+        getSecurityManager().validate(None, wrapped)
         return (wrapped, r[1])
+