Commit 7f23608b authored by Romain Courteaud's avatar Romain Courteaud

Give member access to its own events and tickets.

parent b469825d
......@@ -4,6 +4,10 @@
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='zope'>
<item>Owner</item>
</role>
......
......@@ -4,6 +4,10 @@
<item>Auditor</item>
<item>Author</item>
</role>
<role id='R-MEMBER'>
<item>Auditor</item>
<item>Author</item>
</role>
<role id='zope'>
<item>Owner</item>
</role>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
......@@ -4,4 +4,9 @@
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>Member</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
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
......@@ -4,4 +4,9 @@
<multi_property id='category'>group/company</multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Auditor; Author'>
<property id='title'>Member</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
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination_decision</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<type_roles>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getDestinationValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>destination</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Customer</property>
<property id='description'>Monovalued role</property>
<property id='condition'>python: here.getSourceValue(portal_type='Person') is not None</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromContent</property>
<multi_property id='base_category'>source</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Group company</property>
<multi_property id='category'>group/company</multi_property>
......
<workflow_chain>
<chain>
<type>Acknowledgement</type>
<workflow>local_permission_slapos_interaction_workflow</workflow>
</chain>
<chain>
<type>Computer</type>
<workflow>local_permission_slapos_interaction_workflow</workflow>
......
......@@ -336,3 +336,255 @@ class TestSlapOSLocalPermissionSlapOSInteractionWorkflow(
self.assertSecurityGroup(sale_invoice_transaction, [self.user_id,
'G-COMPANY', self.person_user.getReference()],
False)
def test_SupportRequest_setDestinationDecision(self):
self._makePerson()
support_request = self.portal.support_request_module.newContent(
portal_type='Support Request')
self.assertSecurityGroup(support_request, ['G-COMPANY', self.user_id], False)
support_request.edit(destination_decision=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(support_request, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Acknowledgement_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Acknowledgement')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Acknowledgement_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Acknowledgement')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_FaxMessage_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Fax Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_FaxMessage_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Fax Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Letter_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Letter')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Letter_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Letter')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_MailMessage_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Mail Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_MailMessage_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Mail Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Note_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Note')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Note_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Note')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_PhoneCall_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Phone Call')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_PhoneCall_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Phone Call')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_ShortMessage_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Short Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_ShortMessage_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Short Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_SiteMessage_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Site Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_SiteMessage_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Site Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Visit_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Visit')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_Visit_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Visit')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_WebMessage_setDestination(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Web Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(destination=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
def test_WebMessage_setSource(self):
self._makePerson()
event = self.portal.event_module.newContent(
portal_type='Web Message')
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id], False)
event.edit(source=self.person_user.getRelativeUrl())
transaction.commit()
self.assertSecurityGroup(event, ['G-COMPANY', self.user_id,
self.person_reference], False)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>Base_updateAllLocalRoles</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Event_edit</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>_setDestination.*</string>
<string>_setSource.*</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Acknowledgement</string>
</list>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
157
\ No newline at end of file
158
\ No newline at end of file
Acknowledgement | local_permission_slapos_interaction_workflow
Computer Model | local_permission_slapos_interaction_workflow
Computer Network | local_permission_slapos_interaction_workflow
Computer | local_permission_slapos_interaction_workflow
......
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