[Zope-Checkins] CVS: Zope/lib/python/Zope/App - startup.py:1.1.6.3

Jim Fulton jim@zope.com
Tue, 24 Jun 2003 16:18:32 -0400


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

Modified Files:
      Tag: Zope-2_6-branch
	startup.py 
Log Message:
Updated the hook to reject unauthorized versions to also clear the
associated database version pool.


=== Zope/lib/python/Zope/App/startup.py 1.1.6.2 => 1.1.6.3 ===
--- Zope/lib/python/Zope/App/startup.py:1.1.6.2	Tue Jun 10 13:36:23 2003
+++ Zope/lib/python/Zope/App/startup.py	Tue Jun 24 16:18:31 2003
@@ -114,7 +114,8 @@
 
 def validated_hook(request, user):
     newSecurityManager(request, user)
-    if request.get(Globals.VersionNameName, ''):
+    version = request.get(Globals.VersionNameName, '')
+    if version:
         object = user.aq_parent
         if not getSecurityManager().checkPermission(
             'Join/leave Versions', object):
@@ -123,6 +124,7 @@
                 expires="Mon, 25-Jan-1999 23:59:59 GMT",
                 path=(request['BASEPATH1'] or '/'),
                 )
+            Zope.DB.removeVersionPool(version)
             raise Unauthorized, "You don't have permission to enter versions."