Commit 8ad1fe55 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test Integration Site/Tool local roles

parent c9899abe
<local_roles_item> <local_roles_item>
<local_roles> <local_roles>
<role id='G-COMPANY'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-SHADOW-PERSON'> <role id='R-SHADOW-PERSON'>
<item>Auditor</item> <item>Auditor</item>
</role> </role>
</local_roles> </local_roles>
<local_role_group_ids> <local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal>
</local_role_group_id>
<local_role_group_id id='shadow'> <local_role_group_id id='shadow'>
<principal id='R-SHADOW-PERSON'>Auditor</principal> <principal id='R-SHADOW-PERSON'>Auditor</principal>
</local_role_group_id> </local_role_group_id>
......
<local_roles_item> <local_roles_item>
<local_roles> <local_roles>
<role id='G-COMPANY'>
<item>Assignor</item>
</role>
<role id='R-SHADOW-PERSON'> <role id='R-SHADOW-PERSON'>
<item>Auditor</item> <item>Auditor</item>
<item>Author</item> <item>Author</item>
</role> </role>
</local_roles> </local_roles>
<local_role_group_ids> <local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Assignor</principal>
</local_role_group_id>
<local_role_group_id id='shadow'> <local_role_group_id id='shadow'>
<principal id='R-SHADOW-PERSON'>Auditor</principal> <principal id='R-SHADOW-PERSON'>Auditor</principal>
<principal id='R-SHADOW-PERSON'>Author</principal> <principal id='R-SHADOW-PERSON'>Author</principal>
......
<local_roles_item> <local_roles_item>
<local_roles> <local_roles>
<role id='G-COMPANY'>
<item>Assignor</item>
</role>
<role id='R-SHADOW-PERSON'> <role id='R-SHADOW-PERSON'>
<item>Auditor</item> <item>Auditor</item>
<item>Author</item> <item>Author</item>
</role> </role>
</local_roles> </local_roles>
<local_role_group_ids> <local_role_group_ids>
<local_role_group_id id='group'>
<principal id='G-COMPANY'>Assignor</principal>
</local_role_group_id>
<local_role_group_id id='shadow'> <local_role_group_id id='shadow'>
<principal id='R-SHADOW-PERSON'>Auditor</principal> <principal id='R-SHADOW-PERSON'>Auditor</principal>
<principal id='R-SHADOW-PERSON'>Author</principal> <principal id='R-SHADOW-PERSON'>Author</principal>
......
<type_roles> <type_roles>
<role id='Assignor'>
<property id='title'>Group Company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor; Author'> <role id='Auditor; Author'>
<property id='title'>Person Shadow</property> <property id='title'>Person Shadow</property>
<multi_property id='categories'>local_role_group/shadow</multi_property> <multi_property id='categories'>local_role_group/shadow</multi_property>
......
<type_roles> <type_roles>
<role id='Author; Auditor'>
<property id='title'>Group Company</property>
<multi_property id='categories'>local_role_group/group</multi_property>
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor'> <role id='Auditor'>
<property id='title'>Person Shadow</property> <property id='title'>Person Shadow</property>
<multi_property id='categories'>local_role_group/shadow</multi_property> <multi_property id='categories'>local_role_group/shadow</multi_property>
......
...@@ -2009,3 +2009,23 @@ class TestConsumptionDocumentModule(TestSlapOSGroupRoleSecurityMixin): ...@@ -2009,3 +2009,23 @@ class TestConsumptionDocumentModule(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(module, 'R-COMPUTER', ['Author']) self.assertRoles(module, 'R-COMPUTER', ['Author'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner']) self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestIntegrationTool(TestSlapOSGroupRoleSecurityMixin):
def test_IntegrationTool(self):
module = self.portal.portal_integrations
self.assertSecurityGroup(module,
['R-SHADOW-PERSON', module.Base_getOwnerId()], False)
self.assertRoles(module, 'R-SHADOW-PERSON', ['Auditor'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestIntegrationSite(TestSlapOSGroupRoleSecurityMixin):
def test_IntegrationSite_default(self):
delivery = self.portal.portal_integrations.newContent(
portal_type='Integration Site'
)
self.assertSecurityGroup(delivery,
['R-SHADOW-PERSON', self.user_id], False)
self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, 'R-SHADOW-PERSON', ['Auditor', 'Author'])
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