Commit b4f78dde authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test PDF and Document Module local roles

parent 1805bfd9
<local_roles_item>
<local_roles>
<role id='F-ACCOUNTING*'>
<item>Auditor</item>
<item>Author</item>
</role>
</local_roles>
<local_role_group_ids>
<local_role_group_id id='function'>
<principal id='F-ACCOUNTING*'>Auditor</principal>
<principal id='F-ACCOUNTING*'>Author</principal>
</local_role_group_id>
</local_role_group_ids>
</local_roles_item>
\ No newline at end of file
<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>
<property id='title'>Accountant</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>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignee'>
<property id='title'>Accountant Agent</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/accounting/agent</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
<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>
<property id='title'>Accountant Manager</property>
<multi_property id='categories'>local_role_group/function</multi_property>
<multi_property id='category'>function/accounting/manager</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -1871,3 +1871,24 @@ class TestCertificateLogin(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(delivery, delivery.getParentValue().getUserId(), ['Assignee'])
self.assertRoles(delivery, compute_node.getUserId(), ['Assignor'])
class TestDocumentModule(TestSlapOSGroupRoleSecurityMixin):
def test_DocumentModule(self):
module = self.portal.document_module
self.assertSecurityGroup(module,
['F-ACCOUNTING*', module.Base_getOwnerId()], False)
self.assertRoles(module, 'F-ACCOUNTING*', ['Auditor', 'Author'])
self.assertRoles(module, module.Base_getOwnerId(), ['Owner'])
class TestPDF(TestSlapOSGroupRoleSecurityMixin):
def test_PDF_default(self):
delivery = self.portal.document_module.newContent(
portal_type='PDF')
self.assertSecurityGroup(delivery,
['F-ACCMAN', 'F-ACCAGT',
self.user_id], False)
self.assertRoles(delivery, self.user_id, ['Owner'])
self.assertRoles(delivery, 'F-ACCMAN', ['Assignor'])
self.assertRoles(delivery, 'F-ACCAGT', ['Assignee'])
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