Commit 5d10c747 authored by Hanno Schlichting's avatar Hanno Schlichting

Removed more unused code of the versions support feature including the...

Removed more unused code of the versions support feature including the Globals.VersionNameName constant.
parent ba56938d
...@@ -9,9 +9,6 @@ file HISTORY.txt. ...@@ -9,9 +9,6 @@ file HISTORY.txt.
Trunk Trunk
----- -----
2.12.0a2 (2009-04-19)
---------------------
Known issues Known issues
++++++++++++ ++++++++++++
...@@ -21,14 +18,24 @@ Known issues ...@@ -21,14 +18,24 @@ Known issues
- ZODB 3.9.0a12 does not work on Windows with Python 2.6 yet. - ZODB 3.9.0a12 does not work on Windows with Python 2.6 yet.
- There is no old-style full tarball release that resembles the prior
releases of Zope at this point.
- easy_install support not fully functional yet. - easy_install support not fully functional yet.
Restructuring Restructuring
+++++++++++++ +++++++++++++
- Removed more unused code of the versions support feature including the
Globals.VersionNameName constant.
Bugs Fixed
++++++++++
2.12.0a2 (2009-04-19)
---------------------
Restructuring
+++++++++++++
- If the <permission /> ZCML directive is used to declare a permission that - If the <permission /> ZCML directive is used to declare a permission that
does not exist, the permission will now be created automatically, defaulting does not exist, the permission will now be created automatically, defaulting
to being granted to the Manager role only. This means it is possible to to being granted to the Manager role only. This means it is possible to
......
...@@ -23,9 +23,8 @@ connection_open_hooks = [] ...@@ -23,9 +23,8 @@ connection_open_hooks = []
class ZApplicationWrapper: class ZApplicationWrapper:
def __init__(self, db, name, klass= None, klass_args= (), def __init__(self, db, name, klass= None, klass_args=()):
version_cookie_name=None): self._stuff = db, name
self._stuff = db, name, version_cookie_name
if klass is not None: if klass is not None:
conn=db.open() conn=db.open()
root=conn.root() root=conn.root()
...@@ -35,21 +34,12 @@ class ZApplicationWrapper: ...@@ -35,21 +34,12 @@ class ZApplicationWrapper:
conn.close() conn.close()
self._klass=klass self._klass=klass
# This hack is to overcome a bug in Bobo! # This hack is to overcome a bug in Bobo!
def __getattr__(self, name): def __getattr__(self, name):
return getattr(self._klass, name) return getattr(self._klass, name)
def __bobo_traverse__(self, REQUEST=None, name=None): def __bobo_traverse__(self, REQUEST=None, name=None):
db, aname, version_support = self._stuff db, aname = self._stuff
if version_support is not None and REQUEST is not None:
version=REQUEST.get(version_support,'')
else: version=''
# conn=db.open(version)
# 'version' argument no longer support with ZODB 3.9.
# The cruft for version_support can likely be removed!?
# (ajung, 2009/01/26)
conn = db.open() conn = db.open()
if connection_open_hooks: if connection_open_hooks:
...@@ -75,7 +65,7 @@ class ZApplicationWrapper: ...@@ -75,7 +65,7 @@ class ZApplicationWrapper:
def __call__(self, connection=None): def __call__(self, connection=None):
db, aname, version_support = self._stuff db, aname = self._stuff
if connection is None: if connection is None:
connection=db.open() connection=db.open()
......
...@@ -66,9 +66,6 @@ deprecated("import from OFS.ObjectManager instead", ...@@ -66,9 +66,6 @@ deprecated("import from OFS.ObjectManager instead",
del deprecated del deprecated
DevelopmentMode = False DevelopmentMode = False
VersionNameName='Zope-Version'
# XXX ZODB stashes the main database object here # XXX ZODB stashes the main database object here
opened = [] opened = []
...@@ -12,12 +12,11 @@ ...@@ -12,12 +12,11 @@
# #
############################################################################## ##############################################################################
import os, sys, unittest, tempfile, cStringIO import os, unittest, tempfile, cStringIO
from logging import getLogger from logging import getLogger
import ZODB from OFS.Application import Application, AppInitializer
from OFS.Application import Application, AppInitializer, get_products
import Zope2.Startup import Zope2.Startup
import ZConfig import ZConfig
from App.config import getConfiguration, setConfiguration from App.config import getConfiguration, setConfiguration
...@@ -55,7 +54,7 @@ def getSchema(): ...@@ -55,7 +54,7 @@ def getSchema():
def getApp(): def getApp():
from App.ZApplication import ZApplicationWrapper from App.ZApplication import ZApplicationWrapper
DB = getConfiguration().dbtab.getDatabase('/') DB = getConfiguration().dbtab.getDatabase('/')
return ZApplicationWrapper(DB, 'Application', Application, (), 'foo')() return ZApplicationWrapper(DB, 'Application', Application, ())()
original_config = None original_config = None
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
# #
############################################################################## ##############################################################################
import os, sys, unittest, tempfile, shutil, cStringIO import os, unittest, tempfile, shutil, cStringIO
import ZODB from OFS.Application import Application
from OFS.Application import Application, AppInitializer, get_products
import Zope2.Startup import Zope2.Startup
import ZConfig import ZConfig
from App.config import getConfiguration, setConfiguration from App.config import getConfiguration, setConfiguration
...@@ -66,7 +65,7 @@ def getSchema(): ...@@ -66,7 +65,7 @@ def getSchema():
def getApp(): def getApp():
from App.ZApplication import ZApplicationWrapper from App.ZApplication import ZApplicationWrapper
DB = getConfiguration().dbtab.getDatabase('/') DB = getConfiguration().dbtab.getDatabase('/')
return ZApplicationWrapper(DB, 'Application', Application, (), 'foo')() return ZApplicationWrapper(DB, 'Application', Application, ())()
original_config = None original_config = None
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
""" """
from zope.component import queryMultiAdapter from zope.component import queryMultiAdapter
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
from Acquisition import aq_acquire from Acquisition import aq_acquire
...@@ -24,7 +23,7 @@ from Acquisition import aq_parent ...@@ -24,7 +23,7 @@ from Acquisition import aq_parent
from App.config import getConfiguration from App.config import getConfiguration
from time import asctime from time import asctime
from types import StringType, ListType from types import StringType, ListType
from zExceptions import Unauthorized, Redirect from zExceptions import Redirect
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
import transaction import transaction
import AccessControl.User import AccessControl.User
...@@ -33,7 +32,6 @@ import ExtensionClass ...@@ -33,7 +32,6 @@ import ExtensionClass
import imp import imp
import logging import logging
import OFS.Application import OFS.Application
import os
import sys import sys
import ZODB import ZODB
import App.ZApplication import App.ZApplication
...@@ -108,8 +106,8 @@ def startup(): ...@@ -108,8 +106,8 @@ def startup():
# Set up the "app" object that automagically opens # Set up the "app" object that automagically opens
# connections # connections
app = App.ZApplication.ZApplicationWrapper( app = App.ZApplication.ZApplicationWrapper(
DB, 'Application', OFS.Application.Application, (), DB, 'Application', OFS.Application.Application, ()
Globals.VersionNameName) )
Zope2.bobo_application = app Zope2.bobo_application = app
# Initialize the app object # Initialize the app object
...@@ -134,20 +132,7 @@ def startup(): ...@@ -134,20 +132,7 @@ def startup():
def validated_hook(request, user): def validated_hook(request, user):
import Globals # to fetch data
newSecurityManager(request, user) newSecurityManager(request, user)
version = request.get(Globals.VersionNameName, '')
if version:
object = aq_parent(user)
if not getSecurityManager().checkPermission(
'Join/leave Versions', object):
request['RESPONSE'].setCookie(
Globals.VersionNameName,'No longer active',
expires="Mon, 25-Jan-1999 23:59:59 GMT",
path=(request['BASEPATH1'] or '/'),
)
Zope2.DB.removeVersionPool(version)
raise Unauthorized, "You don't have permission to enter versions."
class RequestContainer(ExtensionClass.Base): class RequestContainer(ExtensionClass.Base):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment