Commit a0c1cc58 authored by Aurel's avatar Aurel

test security on related getter


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21013 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 625e7781
......@@ -2170,6 +2170,7 @@ class TestPropertySheet:
self.assertTrue(guarded_hasattr(obj, 'getRegionValue'))
self.assertTrue(guarded_hasattr(obj, 'getRegionList'))
self.assertTrue(guarded_hasattr(obj, 'getRegionValueList'))
self.assertTrue(guarded_hasattr(obj, 'getRegionRelatedValueList'))
# setter is protected by default with modify portal content
obj.manage_permission(Permissions.ModifyPortalContent, [], 0)
......@@ -2181,6 +2182,7 @@ class TestPropertySheet:
self.assertTrue(guarded_hasattr(obj, 'getRegionValue'))
self.assertTrue(guarded_hasattr(obj, 'getRegionList'))
self.assertTrue(guarded_hasattr(obj, 'getRegionValueList'))
self.assertTrue(guarded_hasattr(obj, 'getRegionRelatedValueList'))
# getter is protected with Access content information
obj.manage_permission(Permissions.ModifyPortalContent, ['Manager'], 1)
......@@ -2193,6 +2195,7 @@ class TestPropertySheet:
self.assertFalse(guarded_hasattr(obj, 'getRegionValue'))
self.assertFalse(guarded_hasattr(obj, 'getRegionList'))
self.assertFalse(guarded_hasattr(obj, 'getRegionValueList'))
self.assertFalse(guarded_hasattr(obj, 'getRegionRelatedValueList'))
def test_PropertySheetSecurityOnAccessors(self):
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment