Commit 2f5018ae authored by Romain Courteaud's avatar Romain Courteaud

Give member access to the template document.

parent 7f23608b
3
\ No newline at end of file
4
\ No newline at end of file
service_module/slapos_crm_acknowledgement
service_module/slapos_crm_complaint
service_module/slapos_crm_information
service_module/slapos_crm_spam
\ No newline at end of file
service_module/slapos_crm_spam
support_request_module/slapos_crm_support_request_template
event_module/slapos_crm_web_message_template
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Assignor</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
</role>
<role id='zope'>
<item>Owner</item>
</role>
</local_roles>
</local_roles_item>
\ No newline at end of file
<local_roles_item>
<local_roles>
<role id='G-COMPANY'>
<item>Assignor</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
</role>
<role id='zope'>
<item>Owner</item>
</role>
</local_roles>
</local_roles_item>
\ No newline at end of file
......@@ -10,4 +10,10 @@
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Member can see template</property>
<property id='condition'>python: here.getRelativeUrl() == here.getPortalObject().portal_preferences.getPreferredSupportRequestTemplate()</property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -18,4 +18,10 @@
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Member can see template</property>
<property id='condition'>python: here.getRelativeUrl() == here.getPortalObject().portal_preferences.getPreferredWebMessageTemplate()</property>
<multi_property id='category'>role/member</multi_property>
<multi_property id='base_category'>role</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -1713,6 +1713,19 @@ class TestWebMessage(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, reference, ['Auditor'])
self.assertRoles(product, self.user_id, ['Owner'])
def test_Template(self):
product = self.portal.restrictedTraverse(
self.portal.portal_preferences.getPreferredWebMessageTemplate())
assert product.getPortalType() == 'Web Message'
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', product.Base_getOwnerId(), 'R-MEMBER'], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, product.Base_getOwnerId(), ['Owner'])
self.assertRoles(product, 'R-MEMBER', ['Auditor'])
self.assertPermissionsOfRole(product, 'Auditor',
['Access contents information', 'View'])
class TestSupportRequestModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.support_request_module
......@@ -1747,6 +1760,19 @@ class TestSupportRequest(TestSlapOSGroupRoleSecurityMixin):
self.assertRoles(product, reference, ['Auditor'])
self.assertRoles(product, self.user_id, ['Owner'])
def test_Template(self):
product = self.portal.restrictedTraverse(
self.portal.portal_preferences.getPreferredSupportRequestTemplate())
assert product.getPortalType() == 'Support Request'
product.updateLocalRolesOnSecurityGroups()
self.assertSecurityGroup(product,
['G-COMPANY', product.Base_getOwnerId(), 'R-MEMBER'], False)
self.assertRoles(product, 'G-COMPANY', ['Assignor'])
self.assertRoles(product, product.Base_getOwnerId(), ['Owner'])
self.assertRoles(product, 'R-MEMBER', ['Auditor'])
self.assertPermissionsOfRole(product, 'Auditor',
['Access contents information', 'View'])
class TestTransformationModule(TestSlapOSGroupRoleSecurityMixin):
def test(self):
module = self.portal.transformation_module
......
158
\ No newline at end of file
159
\ No newline at end of file
......@@ -27,6 +27,7 @@ data_set_module
document_ingestion_module
document_module
event_module
event_module/slapos_crm_web_message_template
hosting_subscription_module
image_module
inventory_module
......@@ -59,6 +60,7 @@ software_instance_module
software_product_module
software_release_module
support_request_module
support_request_module/slapos_crm_support_request_template
system_event_module
transformation_module
web_page_module
\ No newline at end of file
......@@ -61,4 +61,6 @@ software_release_module
support_request_module
system_event_module
transformation_module
web_page_module
\ No newline at end of file
web_page_module
support_request_module/slapos_crm_support_request_template
event_module/slapos_crm_web_message_template
\ No newline at end of file
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