Commit 691116a7 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test Notification Message local roles

parent da801da3
<local_roles_item> <local_roles_item>
<local_roles> <local_roles>
<role id='G-COMPANY'> <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-SALE*'>Auditor</principal>
<principal id='G-COMPANY'>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='Author; Auditor'> <role id='Author; Auditor'>
<property id='title'>Group company</property> <property id='title'>Sale</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/sale*</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>function</multi_property>
</role> </role>
</type_roles> </type_roles>
\ No newline at end of file
<type_roles> <type_roles>
<role id='Assignee'>
<property id='title'>Sale Agent</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/sale/agent</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<role id='Assignor'> <role id='Assignor'>
<property id='title'>Group company</property> <property id='title'>Sale Manager</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/sale/manager</multi_property>
<multi_property id='base_category'>group</multi_property> <multi_property id='base_category'>function</multi_property>
</role> </role>
</type_roles> </type_roles>
\ No newline at end of file
...@@ -1914,3 +1914,24 @@ class TestQuery(TestSlapOSGroupRoleSecurityMixin): ...@@ -1914,3 +1914,24 @@ class TestQuery(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(delivery, self.user_id, ['Owner']) self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, person.getUserId(), []) self.assertRoles(delivery, person.getUserId(), [])
class TestNotificationMessageModule(TestSlapOSGroupRoleSecurityMixin):
def test_NotificationMessageModule(self):
module = self.portal.notification_message_module
self.assertSecurityGroup(module,
['F-SALE*', module.Base_getOwnerId()], False)
self.assertRoles(module, 'F-SALE*', ['Auditor', 'Author'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestNotificationMessage(TestSlapOSGroupRoleSecurityMixin):
def test_NotificationMessage_default(self):
delivery = self.portal.notification_message_module.newContent(
portal_type='Notification Message'
)
self.assertSecurityGroup(delivery,
['F-SALEAGT', 'F-SALEMAN', self.user_id], False)
self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, 'F-SALEAGT', ['Assignee'])
self.assertRoles(delivery, 'F-SALEMAN', ['Assignor'])
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