[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/ Make python security policy work with a boolean __aatus__

Florent Guillaume fg at nuxeo.com
Thu Jun 1 10:44:14 EDT 2006


Log message for revision 68444:
  Make python security policy work with a boolean __aatus__

Changed:
  U   Zope/branches/2.10/lib/python/AccessControl/ImplPython.py
  U   Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py
  U   Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py

-=-
Modified: Zope/branches/2.10/lib/python/AccessControl/ImplPython.py
===================================================================
--- Zope/branches/2.10/lib/python/AccessControl/ImplPython.py	2006-06-01 14:18:32 UTC (rev 68443)
+++ Zope/branches/2.10/lib/python/AccessControl/ImplPython.py	2006-06-01 14:44:13 UTC (rev 68444)
@@ -318,7 +318,7 @@
 
             if p is not None:
                 tp = p.__class__
-                if tp is not int:
+                if tp is not int and tp is not bool:
                     if tp is dict:
                         if isinstance(name, basestring):
                             p = p.get(name)

Modified: Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py
===================================================================
--- Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py	2006-06-01 14:18:32 UTC (rev 68443)
+++ Zope/branches/2.10/lib/python/AccessControl/tests/testZopeSecurityPolicy.py	2006-06-01 14:44:13 UTC (rev 68444)
@@ -113,6 +113,11 @@
     __allow_access_to_unprotected_subobjects__ = 1
 
 
+class UnprotectedSimpleItemBool (SimpleItemish):
+
+    __allow_access_to_unprotected_subobjects__ = True
+
+
 class OwnedSimpleItem(UnprotectedSimpleItem):
     def getOwner(self, info=0):
         if info:
@@ -159,6 +164,7 @@
         a = App()
         self.a = a
         a.item = UnprotectedSimpleItem()
+        a.itemb = UnprotectedSimpleItemBool()
         self.item = a.item
         a.r_item = RestrictedSimpleItem()
         a.item1 = PartlyProtectedSimpleItem1()
@@ -237,11 +243,13 @@
 
     def testAccessToUnprotectedSubobjects(self):
         item = self.item
+        itemb = self.a.itemb
         r_item = self.a.r_item
         item1 = self.a.item1
         item2 = self.a.item2
         item3 = self.a.item3
         self.assertPolicyAllows(item,  'public_prop')
+        self.assertPolicyAllows(itemb, 'public_prop')
         self.assertPolicyDenies(r_item,'public_prop')
         self.assertPolicyAllows(item1, 'public_prop')
         self.assertPolicyAllows(item2, 'public_prop')

Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py
===================================================================
--- Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py	2006-06-01 14:18:32 UTC (rev 68443)
+++ Zope/branches/2.10/lib/python/Products/PageTemplates/Expressions.py	2006-06-01 14:44:13 UTC (rev 68444)
@@ -99,6 +99,8 @@
 class ZopePathExpr(PathExpr):
 
     def __init__(self, name, expr, engine):
+        if name == 'standard' and not expr:
+            expr = 'nothing'
         super(ZopePathExpr, self).__init__(name, expr, engine,
                                            boboAwareZopeTraverse)
 



More information about the Zope-Checkins mailing list