[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ Make
python security policy work with a boolean __aatus__
Florent Guillaume
fg at nuxeo.com
Thu Jun 1 10:48:16 EDT 2006
Log message for revision 68446:
Make python security policy work with a boolean __aatus__
Changed:
U Zope/trunk/lib/python/AccessControl/ImplPython.py
U Zope/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py
-=-
Modified: Zope/trunk/lib/python/AccessControl/ImplPython.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/ImplPython.py 2006-06-01 14:46:17 UTC (rev 68445)
+++ Zope/trunk/lib/python/AccessControl/ImplPython.py 2006-06-01 14:48:15 UTC (rev 68446)
@@ -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/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:46:17 UTC (rev 68445)
+++ Zope/trunk/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:48:15 UTC (rev 68446)
@@ -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')
More information about the Zope-Checkins
mailing list