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.
Trunk
-----
2.12.0a2 (2009-04-19)
---------------------
Known issues
++++++++++++
......@@ -21,14 +18,24 @@ Known issues
- 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.
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
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
......
......@@ -23,9 +23,8 @@ connection_open_hooks = []
class ZApplicationWrapper:
def __init__(self, db, name, klass= None, klass_args= (),
version_cookie_name=None):
self._stuff = db, name, version_cookie_name
def __init__(self, db, name, klass= None, klass_args=()):
self._stuff = db, name
if klass is not None:
conn=db.open()
root=conn.root()
......@@ -35,21 +34,12 @@ class ZApplicationWrapper:
conn.close()
self._klass=klass
# This hack is to overcome a bug in Bobo!
def __getattr__(self, name):
return getattr(self._klass, name)
def __bobo_traverse__(self, REQUEST=None, name=None):
db, aname, version_support = 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)
db, aname = self._stuff
conn = db.open()
if connection_open_hooks:
......@@ -75,7 +65,7 @@ class ZApplicationWrapper:
def __call__(self, connection=None):
db, aname, version_support = self._stuff
db, aname = self._stuff
if connection is None:
connection=db.open()
......
......@@ -66,9 +66,6 @@ deprecated("import from OFS.ObjectManager instead",
del deprecated
DevelopmentMode = False
VersionNameName='Zope-Version'
# XXX ZODB stashes the main database object here
opened = []
......@@ -12,12 +12,11 @@
#
##############################################################################
import os, sys, unittest, tempfile, cStringIO
import os, unittest, tempfile, cStringIO
from logging import getLogger
import ZODB
from OFS.Application import Application, AppInitializer, get_products
from OFS.Application import Application, AppInitializer
import Zope2.Startup
import ZConfig
from App.config import getConfiguration, setConfiguration
......@@ -55,7 +54,7 @@ def getSchema():
def getApp():
from App.ZApplication import ZApplicationWrapper
DB = getConfiguration().dbtab.getDatabase('/')
return ZApplicationWrapper(DB, 'Application', Application, (), 'foo')()
return ZApplicationWrapper(DB, 'Application', Application, ())()
original_config = None
......
......@@ -12,10 +12,9 @@
#
##############################################################################
import os, sys, unittest, tempfile, shutil, cStringIO
import os, unittest, tempfile, shutil, cStringIO
import ZODB
from OFS.Application import Application, AppInitializer, get_products
from OFS.Application import Application
import Zope2.Startup
import ZConfig
from App.config import getConfiguration, setConfiguration
......@@ -66,7 +65,7 @@ def getSchema():
def getApp():
from App.ZApplication import ZApplicationWrapper
DB = getConfiguration().dbtab.getDatabase('/')
return ZApplicationWrapper(DB, 'Application', Application, (), 'foo')()
return ZApplicationWrapper(DB, 'Application', Application, ())()
original_config = None
......
......@@ -14,7 +14,6 @@
"""
from zope.component import queryMultiAdapter
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from Acquisition import aq_acquire
......@@ -24,7 +23,7 @@ from Acquisition import aq_parent
from App.config import getConfiguration
from time import asctime
from types import StringType, ListType
from zExceptions import Unauthorized, Redirect
from zExceptions import Redirect
from ZODB.POSException import ConflictError
import transaction
import AccessControl.User
......@@ -33,7 +32,6 @@ import ExtensionClass
import imp
import logging
import OFS.Application
import os
import sys
import ZODB
import App.ZApplication
......@@ -108,8 +106,8 @@ def startup():
# Set up the "app" object that automagically opens
# connections
app = App.ZApplication.ZApplicationWrapper(
DB, 'Application', OFS.Application.Application, (),
Globals.VersionNameName)
DB, 'Application', OFS.Application.Application, ()
)
Zope2.bobo_application = app
# Initialize the app object
......@@ -134,20 +132,7 @@ def startup():
def validated_hook(request, user):
import Globals # to fetch data
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):
......
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