Commit 85083ce2 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test Credential Update Module local roles

parent 76c71763
<local_roles_item> <local_roles_item>
<local_roles> <local_roles>
<role id='G-COMPANY'> <role id='F-ACCOUNTING*'>
<item>Auditor</item> <item>Auditor</item>
<item>Author</item> <item>Author</item>
</role> </role>
<role id='R-MEMBER'> <role id='F-CUSTOMER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='F-PRODUCTION*'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='F-SALE*'>
<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'> <local_role_group_id id='function'>
<principal id='G-COMPANY'>Auditor</principal> <principal id='F-ACCOUNTING*'>Auditor</principal>
<principal id='G-COMPANY'>Author</principal> <principal id='F-ACCOUNTING*'>Author</principal>
</local_role_group_id> <principal id='F-CUSTOMER'>Auditor</principal>
<local_role_group_id id='user'> <principal id='F-CUSTOMER'>Author</principal>
<principal id='R-MEMBER'>Auditor</principal> <principal id='F-SALE*'>Auditor</principal>
<principal id='R-MEMBER'>Author</principal> <principal id='F-SALE*'>Author</principal>
</local_role_group_id> </local_role_group_id>
</local_role_group_ids> </local_role_group_ids>
</local_roles_item> </local_roles_item>
\ No newline at end of file
<type_roles> <type_roles>
<role id='Auditor; Author'> <role id='Author; Auditor'>
<property id='title'>Group company</property> <property id='title'>Accountant</property>
<multi_property id='categories'>local_role_group/group</multi_property> <multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>group/company</multi_property> <multi_property id='category'>function/accounting*</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>function</multi_property>
</role> </role>
<role id='Auditor; Author'> <role id='Author; Auditor'>
<property id='title'>Member</property> <property id='title'>Member</property>
<multi_property id='categories'>local_role_group/user</multi_property> <multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>role/member</multi_property> <multi_property id='category'>function/customer</multi_property>
<multi_property id='base_category'>role</multi_property> <multi_property id='base_category'>function</multi_property>
</role>
<role id='Author; Auditor'>
<property id='title'>Production</property>
<multi_property id='category'>function/production*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Author; Auditor'>
<property id='title'>Sale</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role> </role>
</type_roles> </type_roles>
\ No newline at end of file
...@@ -1935,3 +1935,16 @@ class TestNotificationMessage(TestSlapOSGroupRoleSecurityMixin): ...@@ -1935,3 +1935,16 @@ class TestNotificationMessage(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(delivery, 'F-SALEAGT', ['Assignee']) self.assertRoles(delivery, 'F-SALEAGT', ['Assignee'])
self.assertRoles(delivery, 'F-SALEMAN', ['Assignor']) self.assertRoles(delivery, 'F-SALEMAN', ['Assignor'])
class TestCredentialUpdateModule(TestSlapOSGroupRoleSecurityMixin):
def test_CredentialUpdateModule(self):
module = self.portal.credential_update_module
self.assertSecurityGroup(module,
['F-ACCOUNTING*', 'F-PRODUCTION*', module.Base_getOwnerId(),
'F-CUSTOMER', 'F-SALE*'], False)
self.assertRoles(module, 'F-ACCOUNTING*', ['Auditor', 'Author'])
self.assertRoles(module, 'F-PRODUCTION*', ['Auditor', 'Author'])
self.assertRoles(module, 'F-CUSTOMER', ['Auditor', 'Author'])
self.assertRoles(module, 'F-SALE*', ['Auditor', 'Author'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
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