m Ec@sqdkZdkZedjo$eeiieiddndZdZedjo endS(Nt__main__is framework.pycCsdS(sCode (in Zope 3) often uses zope.security.management.checkPermission to determine whether the current user has a certain permission in a given context. Five inserts its own interaction that assures that such calls still work. >>> configure_zcml = ''' ... ... ... ... ... ... ''' >>> import Products.Five >>> from Products.Five import zcml >>> zcml.load_config("configure.zcml", Products.Five) >>> zcml.load_string(configure_zcml) In order to be able to traverse to the PageTemplate view, we need a traversable object: >>> from Products.Five.tests.testing import manage_addFiveTraversableFolder >>> manage_addFiveTraversableFolder(self.folder, 'testoid', 'Testoid') Now we access a page that uses zope.security.management.checkPermission(). We see it works as expected: >>> from Products.Five.testbrowser import Browser >>> browser = Browser() >>> browser.open('http://localhost/test_folder_1_/testoid/@@zope3security.html?permission=zope2.View') >>> print browser.contents Yes, you have the 'zope2.View' permission. >>> browser.open('http://localhost/test_folder_1_/testoid/@@zope3security.html?permission=zope2.DeleteObjects') >>> print browser.contents No, you don't have the 'zope2.DeleteObjects' permission. Clean up: >>> from zope.app.testing.placelesssetup import tearDown >>> tearDown() N((((tM/data/zmath/zope/lib/python/Products/Five/browser/tests/test_zope3security.pyttest_check_permissions4cCs'dkl}dkl}|d|S(N(sFunctionalDocTestSuite(sELLIPSISt optionflags(tTesting.ZopeTestCasetFunctionalDocTestSuitetzope.testing.doctesttELLIPSIS(RR((Rt test_suite;s  ( tostsyst__name__texecfiletpathtjoinRRt framework(RR RR ((Rt?s  $ 6