Log message for revision 68447: Make python security policy work with a boolean __aatus__
Changed: U Zope/branches/2.9/lib/python/AccessControl/ImplPython.py U Zope/branches/2.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py -=- Modified: Zope/branches/2.9/lib/python/AccessControl/ImplPython.py =================================================================== --- Zope/branches/2.9/lib/python/AccessControl/ImplPython.py 2006-06-01 14:48:15 UTC (rev 68446) +++ Zope/branches/2.9/lib/python/AccessControl/ImplPython.py 2006-06-01 16:08:52 UTC (rev 68447) @@ -317,7 +317,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.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py =================================================================== --- Zope/branches/2.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 14:48:15 UTC (rev 68446) +++ Zope/branches/2.9/lib/python/AccessControl/tests/testZopeSecurityPolicy.py 2006-06-01 16:08:52 UTC (rev 68447) @@ -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') _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins