[Zope-Checkins] CVS: Zope/lib/python/OFS - Application.py:1.195.2.1 Cache.py:1.11.2.1 ObjectManager.py:1.165.2.1 SimpleItem.py:1.107.2.1 Traversable.py:1.21.12.1

Jim Fulton cvs-admin at zope.org
Tue Nov 25 15:18:04 EST 2003


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

Modified Files:
      Tag: Zope-2_8-devel-branch
	Application.py Cache.py ObjectManager.py SimpleItem.py 
	Traversable.py 
Log Message:
merged everything but ZODB and ZEO from zodb33-devel-branch


=== Zope/lib/python/OFS/Application.py 1.195 => 1.195.2.1 ===
--- Zope/lib/python/OFS/Application.py:1.195	Tue Nov 18 08:17:02 2003
+++ Zope/lib/python/OFS/Application.py	Tue Nov 25 15:17:31 2003
@@ -174,8 +174,8 @@
         result=0
 
         if rebuild:
-            import BTree
-            jar.root()['ZGlobals']=BTree.BTree()
+            from BTrees.OOBTree import OOBTree
+            jar.root()['ZGlobals'] = OOBTree()
             result=1
 
         zglobals =jar.root()['ZGlobals']
@@ -396,8 +396,8 @@
     # Make sure we have Globals
     root=app._p_jar.root()
     if not root.has_key('ZGlobals'):
-        import BTree
-        app._p_jar.root()['ZGlobals']=BTree.BTree()
+        from BTrees.OOBTree import OOBTree
+        app._p_jar.root()['ZGlobals'] = OOBTree()
         get_transaction().note('Added Globals')
         get_transaction().commit()
 
@@ -684,7 +684,7 @@
                 for permission, names in new_permissions:
                     folder_permissions[permission]=names
                 new_permissions.sort()
-                Folder.Folder.__dict__['__ac_permissions__']=tuple(
+                Folder.Folder.__ac_permissions__ = tuple(
                     list(Folder.Folder.__ac_permissions__)+new_permissions)
 
             if not doInstall():


=== Zope/lib/python/OFS/Cache.py 1.11 => 1.11.2.1 ===
--- Zope/lib/python/OFS/Cache.py:1.11	Tue Nov 18 08:17:02 2003
+++ Zope/lib/python/OFS/Cache.py	Tue Nov 25 15:17:31 2003
@@ -92,7 +92,6 @@
         (ViewManagementScreensPermission,
          ('ZCacheable_manage',
           'ZCacheable_invalidate',
-          'ZCacheable_isMethod',
           'ZCacheable_enabled',
           'ZCacheable_getManagerId',
           'ZCacheable_getManagerIds',


=== Zope/lib/python/OFS/ObjectManager.py 1.165 => 1.165.2.1 ===
--- Zope/lib/python/OFS/ObjectManager.py:1.165	Tue Nov 18 08:17:03 2003
+++ Zope/lib/python/OFS/ObjectManager.py	Tue Nov 25 15:17:31 2003
@@ -35,6 +35,7 @@
 import App.Common
 from App.config import getConfiguration
 from AccessControl import getSecurityManager
+from AccessControl.ZopeSecurityPolicy import getRoles
 from zLOG import LOG, ERROR
 from zExceptions import BadRequest
 import sys,fnmatch,copy
@@ -111,7 +112,7 @@
     """
 
     __ac_permissions__=(
-        ('View management screens', ('manage_main','manage_menu')),
+        ('View management screens', ('manage_main',)),
         ('Access contents information',
          ('objectIds', 'objectValues', 'objectItems',''),
          ('Anonymous', 'Manager'),
@@ -636,12 +637,15 @@
         if not (len(REQUEST.PARENTS) > 1 and
                 self.objectValues() == REQUEST.PARENTS[1].objectValues()):
             try:
-                if getSecurityManager().validateValue(self.manage_FTPlist):
+                if getSecurityManager().validate(
+                    None, self, 'manage_FTPlist', self.manage_FTPlist
+                    ):
                     mode=mode | 0770
             except: pass
             if nobody.allowed(
-                        self.manage_FTPlist,
-                        self.manage_FTPlist.__roles__):
+                self.manage_FTPlist,
+                getRoles(self, 'manage_FTPlist', self.manage_FTPlist, ()),
+                self.manage_FTPlist.__roles__):
                 mode=mode | 0007
         mtime=self.bobobase_modification_time().timeTime()
         # get owner and group


=== Zope/lib/python/OFS/SimpleItem.py 1.107 => 1.107.2.1 ===
--- Zope/lib/python/OFS/SimpleItem.py:1.107	Tue Nov 18 08:17:03 2003
+++ Zope/lib/python/OFS/SimpleItem.py	Tue Nov 25 15:17:31 2003
@@ -35,6 +35,7 @@
 from zExceptions import Redirect
 import time
 from zLOG import LOG, BLATHER
+from AccessControl.ZopeSecurityPolicy import getRoles
 
 import marshal
 import ZDOM
@@ -238,25 +239,32 @@
         from AccessControl.User import nobody
         mode=0100000
 
-        # check read permissions
-        if (hasattr(aq_base(self),'manage_FTPget') and
-            hasattr(self.manage_FTPget, '__roles__')):
+        if (hasattr(aq_base(self),'manage_FTPget')):
             try:
-                if getSecurityManager().validateValue(self.manage_FTPget):
+                if getSecurityManager().validate(
+                    None, self, 'manage_FTPget', self.manage_FTPget):
                     mode=mode | 0440
-            except: pass
-            if nobody.allowed(self.manage_FTPget,
-                              self.manage_FTPget.__roles__):
+            except Unauthorized:
+                pass
+            
+            if nobody.allowed(
+                self.manage_FTPget,
+                getRoles(self, 'manage_FTPget', self.manage_FTPget, ()),
+                ):
                 mode=mode | 0004
 
         # check write permissions
-        if hasattr(aq_base(self),'PUT') and hasattr(self.PUT, '__roles__'):
+        if hasattr(aq_base(self),'PUT'):
             try:
-                if getSecurityManager().validateValue(self.PUT):
+                if getSecurityManager().validate(None, self, 'PUT', self.PUT):
                     mode=mode | 0220
-            except: pass
+            except Unauthorized:
+                pass
 
-            if nobody.allowed(self.PUT, self.PUT.__roles__):
+            if nobody.allowed(
+                self.PUT,
+                getRoles(self, 'PUT', self.PUT, ()),
+                ):
                 mode=mode | 0002
 
         # get size


=== Zope/lib/python/OFS/Traversable.py 1.21 => 1.21.12.1 ===
--- Zope/lib/python/OFS/Traversable.py:1.21	Mon Sep 29 08:34:38 2003
+++ Zope/lib/python/OFS/Traversable.py	Tue Nov 25 15:17:31 2003
@@ -91,7 +91,8 @@
             # If the path starts with an empty string, go to the root first.
             pop()
             self=self.getPhysicalRoot()
-            if (restricted and not securityManager.validateValue(self)):
+            if (restricted and not securityManager.validate(
+                None, None, None, self)):
                 raise Unauthorized, name
 
         try:




More information about the Zope-Checkins mailing list