Commit 6f678c50 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: fix Business Process local roles

Accounting people can view the business process
parent 4b30e9a8
<local_roles_item> <local_roles_item>
<local_roles> <local_roles>
<role id='F-ACCOUNTING*'>
<item>Auditor</item>
</role>
<role id='F-SALE*'> <role id='F-SALE*'>
<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='function'> <local_role_group_id id='function'>
<principal id='F-ACCOUNTING*'>Auditor</principal>
<principal id='F-SALE*'>Auditor</principal> <principal id='F-SALE*'>Auditor</principal>
</local_role_group_id> </local_role_group_id>
</local_role_group_ids> </local_role_group_ids>
......
<local_roles_item> <local_roles_item>
<local_roles> <local_roles>
<role id='F-ACCOUNTING*'>
<item>Auditor</item>
</role>
<role id='F-SALE*'> <role id='F-SALE*'>
<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='function'> <local_role_group_id id='function'>
<principal id='F-ACCOUNTING*'>Auditor</principal>
<principal id='F-SALE*'>Auditor</principal> <principal id='F-SALE*'>Auditor</principal>
</local_role_group_id> </local_role_group_id>
</local_role_group_ids> </local_role_group_ids>
......
<type_roles> <type_roles>
<role id='Auditor'>
<property id='title'>Accounting</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/accounting*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Auditor'> <role id='Auditor'>
<property id='title'>Sale</property> <property id='title'>Sale</property>
<multi_property id='categories'>local_role_group/function</multi_property> <multi_property id='categories'>local_role_group/function</multi_property>
......
<type_roles> <type_roles>
<role id='Auditor'>
<property id='title'>Accounting</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/accounting*</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Auditor'> <role id='Auditor'>
<property id='title'>Sale</property> <property id='title'>Sale</property>
<multi_property id='categories'>local_role_group/function</multi_property> <multi_property id='categories'>local_role_group/function</multi_property>
......
...@@ -1620,3 +1620,25 @@ class TestOrganisation(TestSlapOSGroupRoleSecurityMixin): ...@@ -1620,3 +1620,25 @@ class TestOrganisation(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(delivery, 'F-SALEMAN', ['Assignor']) self.assertRoles(delivery, 'F-SALEMAN', ['Assignor'])
self.assertRoles(delivery, 'R-SHADOW-PERSON', ['Auditor']) self.assertRoles(delivery, 'R-SHADOW-PERSON', ['Auditor'])
class TestBusinessProcessModule(TestSlapOSGroupRoleSecurityMixin):
def test_BusinessProcessModule(self):
module = self.portal.business_process_module
self.assertSecurityGroup(module,
['F-SALE*', 'F-ACCOUNTING*',
module.Base_getOwnerId()], False)
self.assertRoles(module, 'F-SALE*', ['Auditor'])
self.assertRoles(module, 'F-ACCOUNTING*', ['Auditor'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestBusinessProcess(TestSlapOSGroupRoleSecurityMixin):
def test_BusinessProcess_default(self):
delivery = self.portal.business_process_module.newContent(
portal_type='Business Process')
self.assertSecurityGroup(delivery,
['F-SALE*', 'F-ACCOUNTING*', self.user_id], False)
self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, 'F-SALE*', ['Auditor'])
self.assertRoles(delivery, 'F-ACCOUNTING*', ['Auditor'])
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