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

slapos_cloud:

* project needed in test
* no requestTransfer anymore
* project needed
* no source_administration
* person need right assignment
* open/personal does not exist anymore
* drop organisation_slap_interface_workflow
  Security is only based on project now.
  Organisation will only be used by accountants
* only project admin can create Computer Network
* drop the idea of project owner
  Project will be products sold on the store
* project needed in test
* assignment needed to touch compute node
* project needed in compute node / instance
* project needed in test
  Allocation Supply is now needed...
* person can not request project anymore
parent 0050d7ca
......@@ -35,10 +35,6 @@
<type>Instance Tree</type>
<workflow>edit_workflow, instance_slap_interface_workflow, instance_tree_workflow</workflow>
</chain>
<chain>
<type>Organisation</type>
<workflow>organisation_slap_interface_workflow</workflow>
</chain>
<chain>
<type>Person</type>
<workflow>person_slap_interface_workflow</workflow>
......
......@@ -269,7 +269,8 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
instance_xml=self.generateSafeXml(),
sla_xml=self.generateEmptyXml(),
shared=False,
state="started"
state="started",
project_reference=project.getReference()
)
self.person_user = self.makePerson(project, new_id=new_id, index=False)
......@@ -289,7 +290,8 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
sla_xml=self.request_kw['sla_xml'],
root_slave=self.request_kw['shared'],
successor=self.software_instance.getRelativeUrl(),
destination_section=self.person_user.getRelativeUrl()
destination_section_value=self.person_user,
follow_up_value=project
)
self.instance_tree.validate()
self.portal.portal_workflow._jumpToStateFor(self.instance_tree, 'start_requested')
......@@ -304,7 +306,8 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'],
specialise=self.instance_tree.getRelativeUrl(),
successor=self.requested_software_instance.getRelativeUrl()
successor=self.requested_software_instance.getRelativeUrl(),
follow_up_value=project
)
self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested')
self.software_instance.validate()
......@@ -318,6 +321,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'],
specialise=self.instance_tree.getRelativeUrl(),
follow_up_value=project
)
self.portal.portal_workflow._jumpToStateFor(self.requested_software_instance, 'start_requested')
self.requested_software_instance.validate()
......
......@@ -47,8 +47,9 @@ class TestSlapOSCloudSlapOSCacheMixin(
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
self.pinDateTime(DateTime())
self._makeComputeNode()
self._makeComplexComputeNode(with_slave=True)
project = self.addProject()
self._makeComputeNode(project)
self._makeComplexComputeNode(project, with_slave=True)
self.tic()
def beforeTearDown(self):
......@@ -368,7 +369,8 @@ class TestSlapOSCloudSoftwareInstance(
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
self._makeTree()
self.project = self.addProject()
self._makeTree(self.project)
def test_getXmlAsDict(self):
simple_parameter_sample_xml = """<?xml version='1.0' encoding='utf-8'?>
......@@ -431,8 +433,8 @@ class TestSlapOSCloudSoftwareInstance(
self.software_instance._asParameterDict)
def test_asParameterDict(self):
self._makeComputeNode()
self._makeComplexComputeNode(with_slave=True)
self._makeComputeNode(self.project)
self._makeComplexComputeNode(self.project, with_slave=True)
as_parameter_dict = self.start_requested_software_instance._asParameterDict()
......@@ -477,8 +479,8 @@ class TestSlapOSCloudSoftwareInstance(
self.assertEqual(as_parameter_dict["full_ip_list"], [])
def test_getInstanceTreeIpList(self):
self._makeComputeNode()
self._makeComplexComputeNode(with_slave=True)
self._makeComputeNode(self.project)
self._makeComplexComputeNode(self.project, with_slave=True)
self.tic()
self.assertEqual([(u'', u'ip_address_1')],
......@@ -489,18 +491,16 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
self.project = self.addProject()
# Prepare compute_node
self.compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
self.compute_node.edit(
title="Compute Node %s" % self.new_id,
reference="TESTCOMP-%s" % self.new_id
reference="TESTCOMP-%s" % self.new_id,
follow_up_value=self.project
)
if getattr(self, "person", None) is not None:
self.compute_node.edit(
source_administration_value=getattr(self, "person", None),
)
self.compute_node.validate()
self._addCertificateLogin(self.compute_node)
......@@ -521,7 +521,7 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
# TestSlapOSSlapToolgetFullComputerInformation.test_activate_getFullComputerInformation_first_access
#
self._makeComplexComputeNode(with_slave=True)
self._makeComplexComputeNode(self.project, with_slave=True)
self.portal.REQUEST['disable_isTestRun'] = True
self.login(self.compute_node_user_id)
......
......@@ -31,7 +31,7 @@ class TestSlapOSCoreComputePartitionSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.compute_node.edit(
title="compute node %s" % (self.new_id, ),
reference="TESTCOMP-%s" % (self.new_id, ),
allocation_scope='open/personal',
allocation_scope='open',
capacity_scope='open',
)
self.compute_node.validate()
......
......@@ -23,14 +23,19 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_ComputeNode_setSubjectList(self):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.addProjectProductionManagerAssignment(self.person_user, project)
self.tic()
self.login(self.person_user.getUserId())
new_id = self.generateNewId()
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
title="Compute Node %s for %s" % (new_id, self.person_user.getReference()),
reference="TESTCOMP-%s" % new_id)
reference="TESTCOMP-%s" % new_id,
follow_up_value=project
)
self.tic()
assert compute_node.getDestinationSectionValue() is None
......@@ -40,7 +45,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
self.person_user.getRelativeUrl()
def check_Instance_validate(self, portal_type):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
# Instance Tree required for security.
......@@ -49,14 +55,17 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
title="HS %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTHS-%s" % self.new_id,
destination_reference="TESTHS-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl()
destination_section=self.person_user.getRelativeUrl(),
follow_up_value=project
)
instance = self.portal.software_instance_module.newContent(
portal_type=portal_type,
title="Instance %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTINST-%s" % self.new_id,
specialise_value=hs)
specialise_value=hs,
follow_up_value=project
)
if portal_type == "Software Instance":
self._addCertificateLogin(instance)
......@@ -89,7 +98,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_Instance_validate("Slave Instance")
def test_SlaveInstance_requestDestroy(self):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
# Instance Tree required for security.
......@@ -98,7 +108,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
title="HS %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTHS-%s" % self.new_id,
destination_reference="TESTHS-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl()
destination_section=self.person_user.getRelativeUrl(),
follow_up_value=project
)
instance = self.portal.software_instance_module.newContent(
......@@ -107,7 +118,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
reference="TESTINST-%s" % self.new_id,
destination_reference="TESTINST-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl(),
specialise_value=hs
specialise_value=hs,
follow_up_value=project
)
request_kw = dict(
software_release='http://example.org',
......@@ -124,18 +136,24 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
self.assertEqual(instance.getValidationState(), 'invalidated')
def check_SoftwareInstallation_changeState(self, method_id):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.addProjectProductionManagerAssignment(self.person_user, project)
self.tic()
self.login(self.person_user.getUserId())
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
title="Compute Node %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTCOMP-%s" % self.new_id)
reference="TESTCOMP-%s" % self.new_id,
follow_up_value=project
)
self._addCertificateLogin(compute_node)
installation = self.portal.software_installation_module.newContent(
portal_type='Software Installation',
title="Installation %s for %s" % (self.new_id, self.person_user.getReference()),
aggregate_value=compute_node,
follow_up_value=project
)
self.tic()
......@@ -165,20 +183,31 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_SoftwareInstallation_changeState('requestDestroy')
def check_SoftwareInstance_changeState(self, method_id):
self.person_user = self.makePerson()
self.login(self.person_user.getUserId())
project = self.addProject()
self.person_user = self.makePerson(project)
self.addProjectProductionManagerAssignment(self.person_user, project)
new_id = self.generateNewId()
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
title="Compute Node %s for %s" % (new_id, self.person_user.getReference()),
<<<<<<< HEAD
reference="TESTCOMP-%s" % new_id)
self._addCertificateLogin(compute_node)
=======
reference="TESTCOMP-%s" % new_id,
follow_up_value=project
)
self._addERP5Login(compute_node)
>>>>>>> 1561dc0c2 (slapos_cloud: assignment needed to touch compute node)
partition = compute_node.newContent(
portal_type='Compute Partition',
title="Partition Compute Node %s for %s" % (new_id,
self.person_user.getReference()),
reference="TESTPART-%s" % new_id)
self.login(self.person_user.getUserId())
instance = self.portal.software_instance_module.newContent(
portal_type="Software Instance",
title="Instance %s for %s" % (new_id, self.person_user.getReference()),
......@@ -187,6 +216,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference="TESTINST-%s" % new_id,
ssl_certificate="foo",
ssl_key="bar",
follow_up_value=project
)
request_kw = dict(
......@@ -230,7 +260,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_SoftwareInstance_changeState("requestDestroy")
def check_change_instance_parameter(self, portal_type, method_id):
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
instance = self.portal.software_instance_module.newContent(
......@@ -240,6 +271,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference="TESTINST-%s" % self.new_id,
ssl_certificate="foo",
ssl_key="bar",
follow_up_value=project
)
self.tic()
......@@ -286,7 +318,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_SoftwareInstance_setSuccessorList(self):
portal_type = "Software Instance"
self.person_user = self.makePerson()
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
new_id = self.generateNewId()
......@@ -297,6 +330,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference="TESTINST-%s" % new_id,
ssl_certificate="foo",
ssl_key="bar",
follow_up_value=project
)
new_id = self.generateNewId()
......@@ -308,6 +342,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
ssl_certificate="foo",
ssl_key="bar",
successor_value=instance3,
follow_up_value=project
)
new_id = self.generateNewId()
......@@ -319,6 +354,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
ssl_certificate="foo",
ssl_key="bar",
successor_value=instance2,
follow_up_value=project
)
self.tic()
......
......@@ -19,8 +19,6 @@
#
##############################################################################
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
from time import sleep
from zExceptions import Unauthorized
import transaction
class TestSlapOSCoreNetworkSlapInterfaceWorkflow(SlapOSTestCaseMixin):
......@@ -28,8 +26,10 @@ class TestSlapOSCoreNetworkSlapInterfaceWorkflow(SlapOSTestCaseMixin):
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
portal = self.getPortalObject()
person_user = self.makePerson()
self.project = self.addProject()
person_user = self.makePerson(self.project)
self.addProjectProductionManagerAssignment(person_user, self.project)
self.tic()
# Login as new user
......@@ -39,7 +39,8 @@ class TestSlapOSCoreNetworkSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.assertEqual(person_user.getRelativeUrl(), new_person.getRelativeUrl())
self.network = portal.computer_network_module.newContent(
portal_type="Computer Network"
portal_type="Computer Network",
follow_up_value=self.project
)
self.tic()
self.assertEqual(
......@@ -62,200 +63,3 @@ class TestSlapOSCoreNetworkSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.network.validate()
# Don't raise if network is validated
self.assertEqual(self.network.approveRegistration(), None)
def _makeProject(self):
project = self.portal.project_module.newContent()
project.edit(reference="TESTPROJ-%s" % project.getId())
project.validate()
self.tic()
return project
def _makeOrganisation(self):
organisation = self.portal.organisation_module.newContent()
organisation.edit(reference="TESTSITE-%s" % organisation.getId())
organisation.validate()
self.tic()
return organisation
def test_ComputerNetwork_requestTransfer_project(self):
source_administrator = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.network.setSourceAdministrationValue(source_administrator)
self.login()
self.network.approveRegistration()
project = self._makeProject()
other_project = self._makeProject()
self.tic()
self.login(source_administrator.getUserId())
self.assertEqual(self.network.Item_getCurrentProjectValue(), None)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), None)
# Place in a project
self.network.requestTransfer(
destination_section=None,
destination_project=project.getRelativeUrl())
self.tic()
self.assertEqual(self.network.Item_getCurrentProjectValue(), project)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), source_administrator)
self.assertEqual(1,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
self.login(source_administrator.getUserId())
# We don't remove from Project if destination project is not provided
self.network.requestTransfer(
destination_project=None,
destination_section=None
)
self.tic()
self.assertEqual(self.network.Item_getCurrentProjectValue(), project)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), source_administrator)
self.assertEqual(2,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep(1)
# Place in another project
self.network.requestTransfer(
destination_section=None,
destination_project=other_project.getRelativeUrl())
self.tic()
self.assertEqual(self.network.Item_getCurrentProjectValue(), other_project)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), source_administrator)
self.assertEqual(3,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
self.login(source_administrator.getUserId())
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep(1)
# We don't remove from Project if destination project is not provided
self.network.requestTransfer(
destination_project=None,
destination_section=None
)
self.tic()
self.assertEqual(self.network.Item_getCurrentProjectValue(), other_project)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), source_administrator)
self.assertEqual(4,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
def test_ComputerNetwork_requestTransfer_owner(self):
source_administrator = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.network.setSourceAdministrationValue(source_administrator)
self.login()
self.network.approveRegistration()
organisation = self._makeOrganisation()
other_organisation = self._makeOrganisation()
self.tic()
self.login(source_administrator.getUserId())
self.assertEqual(self.network.Item_getCurrentProjectValue(), None)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), None)
self.network.requestTransfer(
destination_project=None,
destination_section=organisation.getRelativeUrl())
self.tic()
self.assertEqual(self.network.Item_getCurrentProjectValue(), None)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), organisation)
self.assertEqual(1,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
self.login(source_administrator.getUserId())
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep(1)
# We don't remove from Project if destination project is not provided
self.network.requestTransfer(
destination_project=None,
destination_section=None)
self.tic()
self.assertEqual(self.network.Item_getCurrentProjectValue(), None)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), organisation)
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep(1)
# Place in another project
self.network.requestTransfer(
destination_project=None,
destination_section=other_organisation.getRelativeUrl())
self.tic()
self.assertEqual(3,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
self.assertEqual(self.network.Item_getCurrentProjectValue(), None)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), other_organisation)
self.assertEqual(3,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
self.login(source_administrator.getUserId())
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep(1)
# We don't remove from Project if destination project is not provided
self.network.requestTransfer(
destination_project=None,
destination_section=None
)
self.tic()
self.assertEqual(self.network.Item_getCurrentProjectValue(), None)
self.assertEqual(self.network.Item_getCurrentOwnerValue(), other_organisation)
self.assertEqual(4,
len(self.network.getAggregateRelatedList(portal_type="Internal Packing List Line"))
)
def test_ComputerNetwork_requestTransfer_Unauthorized(self):
self.network.approveRegistration()
self.login()
self.assertRaises(Unauthorized, self.network.requestTransfer)
source_administrator = self.makePerson(user=1)
self.assertEqual(1 , len(source_administrator.objectValues( portal_type="ERP5 Login")))
self.login(source_administrator.getUserId())
self.assertRaises(Unauthorized, self.network.requestTransfer)
self.login()
other_user = self.makePerson(user=1)
self.assertEqual(1 , len(other_user.objectValues(portal_type="ERP5 Login")))
self.network.setSourceAdministrationValue(source_administrator)
self.tic()
self.assertRaises(Unauthorized, self.network.requestTransfer)
self.login(other_user.getUserId())
self.assertRaises(Unauthorized, self.network.requestTransfer)
self.login(source_administrator.getUserId())
self.network.requestTransfer(
destination_project=None,
destination_section=None
)
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudNetworkSlapInterfaceWorkflow</string> </value>
......@@ -61,28 +55,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -95,7 +74,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -104,7 +83,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
from zExceptions import Unauthorized
import transaction
class TestSlapOSCoreOrganisationSlapInterfaceWorkflow(SlapOSTestCaseMixin):
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
portal = self.getPortalObject()
person_user = self.makePerson()
self.tic()
# Login as new user
self.login(person_user.getUserId())
new_person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.assertEqual(person_user.getRelativeUrl(), new_person.getRelativeUrl())
self.organisation = portal.organisation_module.newContent(
portal_type="Organisation"
)
self.tic()
def beforeTearDown(self):
transaction.abort()
def test_organisation_approveRegistration_with_reference(self):
reference = "TEST-%s" % self.generateNewId()
self.organisation.setReference(reference)
self.organisation.approveRegistration()
self.assertEqual(self.organisation.getReference(), reference)
def test_organisation_approveRegistration_already_validated(self):
# Login as admin since user cannot re-approve a validated organisation
self.login()
self.organisation.setReference(None)
self.organisation.validate()
# Don't raise if organisation is validated
self.assertEqual(self.organisation.approveRegistration(), None)
def test_organisation_approveRegistration_site(self, role="host", expected_prefix="SITE-"):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.organisation.edit(role=role)
self.organisation.approveRegistration()
self.tic()
self.logout()
self.login(person.getUserId())
self.assertEqual(self.organisation.getValidationState(),
'validated')
self.assertTrue(self.organisation.getReference().startswith(expected_prefix),
"Reference don't start with %s : %s " % (
expected_prefix, self.organisation.getReference()))
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationValue() == self.organisation]
self.assertEqual(len(assignment_list), 1)
self.assertEqual(assignment_list[0].getValidationState(), 'open')
self.assertIn("Assigment for Organisation ", assignment_list[0].getTitle())
def test_organisation_approveRegistration_organisation(self):
self.test_organisation_approveRegistration_site(role="client", expected_prefix="O-")
def test_organisation_leaveOrganisation_no_user(self):
self.login()
self.assertRaises(Unauthorized, self.organisation.leaveOrganisation)
def test_organisation_leaveOrganisation_after_join(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
# Just make things fast, by using the API tested above
self.organisation.approveRegistration()
self.tic()
self.logout()
self.login(person.getUserId())
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationValue() == self.organisation]
self.assertEqual(len(assignment_list), 1)
self.assertEqual(assignment_list[0].getValidationState(), 'open')
self.organisation.leaveOrganisation()
self.tic()
self.login()
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationValue() == self.organisation]
self.assertEqual(len(assignment_list), 1)
self.assertEqual(assignment_list[0].getValidationState(), 'closed')
def test_organisation_acceptInvitation_no_invitation_token(self):
self.assertRaises(TypeError, self.organisation.acceptInvitation)
def test_organisation_acceptInvitation_no_token_dont_exist(self):
self.assertRaises(ValueError, self.organisation.acceptInvitation,
invitation_token="DONOTEXIST")
def test_organisation_acceptInvitation(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.login()
token = self.portal.invitation_token_module.newContent(
portal_type="Invitation Token"
)
token_id = token.getId()
# User is None
self.assertRaises(ValueError, self.organisation.acceptInvitation,
invitation_token=token_id)
# Not validated yet
self.login(person.getUserId())
self.assertRaises(ValueError, self.organisation.acceptInvitation,
invitation_token=token_id)
self.login()
token.validate()
token.setSourceValue(person)
self.login(person.getUserId())
# Not used by the owner
self.assertRaises(ValueError, self.organisation.acceptInvitation,
invitation_token=token_id)
self.login()
token.setSourceValue(None)
self.login(person.getUserId())
self.organisation.acceptInvitation(invitation_token=token_id)
self.tic()
self.login()
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationValue() == self.organisation]
self.assertEqual(len(assignment_list), 1)
self.assertEqual(assignment_list[0].getValidationState(), 'open')
self.assertEqual(token.getValidationState(), "invalidated")
def test_organisation_acceptInvitation_already_member(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.organisation.approveRegistration()
self.tic()
self.login()
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationValue() == self.organisation]
self.assertEqual(len(assignment_list), 1)
self.assertEqual(assignment_list[0].getValidationState(), 'open')
token = self.portal.invitation_token_module.newContent(
portal_type="Invitation Token"
)
token_id = token.getId()
# User is None
self.assertRaises(ValueError, self.organisation.acceptInvitation,
invitation_token=token_id)
# Not validated yet
self.login(person.getUserId())
self.assertRaises(ValueError, self.organisation.acceptInvitation,
invitation_token=token_id)
self.login()
token.validate()
token.setSourceValue(person)
self.login(person.getUserId())
# Not used by the owner
self.assertRaises(ValueError, self.organisation.acceptInvitation,
invitation_token=token_id)
self.login()
token.setSourceValue(None)
self.login(person.getUserId())
self.organisation.acceptInvitation(invitation_token=token_id)
self.tic()
self.login()
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationValue() == self.organisation]
self.assertEqual(len(assignment_list), 1)
self.assertEqual(assignment_list[0].getValidationState(), 'open')
self.assertEqual(token.getValidationState(), "invalidated")
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudOrganisationSlapInterfaceWorkflow</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSCloudOrganisationSlapInterfaceWorkflow</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -26,9 +26,9 @@ class TestSlapOSCoreProjectSlapInterfaceWorkflow(SlapOSTestCaseMixin):
def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self)
portal = self.getPortalObject()
person_user = self.makePerson()
self.project = self.addProject()
person_user = self.makePerson(self.project)
self.tic()
# Login as new user
......@@ -37,9 +37,6 @@ class TestSlapOSCoreProjectSlapInterfaceWorkflow(SlapOSTestCaseMixin):
new_person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.assertEqual(person_user.getRelativeUrl(), new_person.getRelativeUrl())
self.project = portal.project_module.newContent(
portal_type="Project"
)
# Value set by the init
self.assertTrue(self.project.getReference().startswith("PROJ-"),
"Reference don't start with PROJ- : %s" % self.project.getReference())
......@@ -48,62 +45,16 @@ class TestSlapOSCoreProjectSlapInterfaceWorkflow(SlapOSTestCaseMixin):
def beforeTearDown(self):
transaction.abort()
def test_project_approveRegistration_no_reference(self):
self.project.setReference(None)
self.assertRaises(ValueError, self.project.approveRegistration)
def test_project_approveRegistration_already_validated(self):
# Login as admin since user cannot re-approve a validated project
self.login()
self.project.setReference(None)
self.project.validate()
# Don't raise if project is validated
self.assertEqual(self.project.approveRegistration(), None)
def test_project_approveRegistration(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.project.approveRegistration()
self.tic()
self.logout()
self.login(person.getUserId())
self.assertEqual(self.project.getValidationState(),
'validated')
self.assertNotEqual(self.project.getStartDate(),
None)
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationProjectValue() == self.project]
self.assertEqual(len(assignment_list), 1)
self.assertEqual(assignment_list[0].getValidationState(), 'open')
self.assertIn("Assigment for Project ", assignment_list[0].getTitle())
def test_project_leaveProject_no_user(self):
self.login()
self.assertRaises(Unauthorized, self.project.leaveProject)
def test_project_leaveProject_owner(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.project.edit(destination_decision=person.getRelativeUrl())
self.tic()
self.project.leaveProject()
self.assertEqual(self.project.getDestinationDecision(),
None)
def test_project_leaveProject_after_join(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
# Just make things fast, by using the API tested above
self.project.approveRegistration()
self.tic()
self.logout()
self.login(person.getUserId())
......@@ -173,8 +124,6 @@ class TestSlapOSCoreProjectSlapInterfaceWorkflow(SlapOSTestCaseMixin):
def test_project_acceptInvitation_already_member(self):
person = self.portal.portal_membership.getAuthenticatedMember().getUserValue()
self.project.approveRegistration()
self.tic()
self.login()
assignment_list = [i for i in person.objectValues(portal_type="Assignment")
if i.getDestinationProjectValue() == self.project]
......
......@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudProjectSlapInterfaceWorkflow</string> </value>
......@@ -61,28 +55,13 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -95,7 +74,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -104,7 +83,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>source/portal_workflow/organisation_slap_interface_workflow/state_draft</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>person_slap_interface_workflow</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>organisation_slap_interface_workflow</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>manager_bypass</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow</string> </value>
</item>
<item>
<key> <string>state_variable</string> </key>
<value> <string>slap_state</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Organisation Slap Interface Workflow</string> </value>
</item>
<item>
<key> <string>workflow_managed_permission</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
organisation = state_change['object']
portal = organisation.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
# Get required arguments
kwargs = state_change.kwargs
# Required args
# Raise TypeError if all parameters are not provided
try:
token_id = kwargs['invitation_token']
except KeyError:
raise TypeError("Organisation_acceptInvitation takes exactly 1 argument")
try:
invitation_token = portal.invitation_token_module[token_id]
except KeyError:
raise ValueError("The Invitation Token can't be found, please review the URL.")
if person is None:
message_str = "Please login before access the invitation link."
raise ValueError(message_str)
if invitation_token.getPortalType() != "Invitation Token":
message_str = "The Invitation Token can't be found, please review the URL."
raise ValueError(message_str)
if invitation_token.getValidationState() != "validated":
message_str = "The Invitation Token was already used and it cannot be reused, please ask a new one."
raise ValueError(message_str)
if invitation_token.getSourceValue() == person:
message_str = "Invitation Token cannot be used by the same user that generated the token!"
raise ValueError(message_str)
for assignment in person.objectValues(portal_type="Assignment"):
if assignment.getSubordination() == organisation.getRelativeUrl() and \
assignment.getValidationState() == "open":
invitation_token.invalidate(comment="User already has assignment to the Person")
break
if invitation_token.getValidationState() == "validated":
person.newContent(
title="Assigment for Organisation (%s) %s" % (organisation.getRole(), organisation.getTitle()),
portal_type="Assignment",
subordination_value=organisation,
destination_value=organisation).open()
invitation_token.invalidate()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Organisation_acceptInvitation</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Organisation_acceptInvitation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
organisation = state_change["object"]
portal = context.getPortalObject()
role = organisation.getRole()
if role == "host":
reference_prefix = "SITE"
else:
reference_prefix = "O"
if organisation.getReference() in [None, ""]:
reference = "%s-%s" % (reference_prefix, portal.portal_ids.generateNewId(
id_group='slap_organisation_reference',
id_generator='uid'))
organisation.setReference(reference)
if organisation.getValidationState() != "draft":
return
organisation.validate()
# Get the user id of the context owner.
local_role_list = organisation.get_local_roles()
for group, role_list in local_role_list:
if 'Owner' in role_list:
user_id = group
break
person = portal.portal_catalog.getResultValue(user_id=user_id)
if person is None:
# Value was created by super user, so there isn't a point on continue
return
for assignment in person.objectValues(portal_type="Assignment"):
if assignment.getSubordination() == organisation.getRelativeUrl():
if assignment.getValidationState() != "open":
assignment.open()
return
person.newContent(
title="Assigment for Organisation (%s) %s" % (organisation.getRole(), organisation.getTitle()),
portal_type="Assignment",
subordination_value=organisation,
destination_value=organisation).open()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Organisation_approveRegistration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Organisation_approveRegistration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Organisation_checkConsistency</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from zExceptions import Unauthorized
organisation = state_change['object']
portal = organisation.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
if person is None:
raise Unauthorized
for assignment in person.objectValues(portal_type="Assignment"):
if assignment.getDestination() == organisation.getRelativeUrl():
assignment.close()
break
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Organisation_leaveOrganisation</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow State" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>acquire_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/portal_workflow/organisation_slap_interface_workflow/transition_accept_invitation</string>
<string>destination/portal_workflow/organisation_slap_interface_workflow/transition_approve_registration</string>
<string>destination/portal_workflow/organisation_slap_interface_workflow/transition_leave_organisation</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>state_draft</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow State</string> </value>
</item>
<item>
<key> <string>state_permission_role_list_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>state_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Draft</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>after_script/portal_workflow/organisation_slap_interface_workflow/script_Organisation_acceptInvitation</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_accept_invitation</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Transition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accept Invitation</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/organisation_slap_interface_workflow/script_Organisation_checkConsistency</string>
<string>after_script/portal_workflow/organisation_slap_interface_workflow/script_Organisation_approveRegistration</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_approve_registration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Transition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Approve Registration</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/organisation_slap_interface_workflow/script_Organisation_checkConsistency</string>
<string>after_script/portal_workflow/organisation_slap_interface_workflow/script_Organisation_leaveOrganisation</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_leave_organisation</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Transition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Leave Organisation</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The last transition</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_action</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Variable</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>variable_default_expression</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The name of the user who performed the last transition</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_actor</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Variable</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>variable_default_expression</string> </key>
<value> <string>user/getUserName</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Comments about the last transition</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_comment</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Variable</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>variable_default_expression</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Error message if validation failed</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_error_message</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Variable</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Provides access to workflow history</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_history</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Variable</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>variable_default_expression</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>portal type (use as filter for worklists)</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_portal_type</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Variable</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Variable" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>automatic_update</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Time of the last transition</string> </value>
</item>
<item>
<key> <string>for_catalog</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>variable_time</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Variable</string> </value>
</item>
<item>
<key> <string>status_included</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>variable_default_expression</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
person = state_change['object']
portal = person.getPortalObject()
# Get required arguments
kwargs = state_change.kwargs
# Required args
# Raise TypeError if all parameters are not provided
try:
project_title = kwargs['project_title']
except KeyError:
raise TypeError, "Person_requestProject takes exactly 1 argument"
tag = "%s_%s_ProjectInProgress" % (person.getUid(),
project_title)
if (portal.portal_activities.countMessageWithTag(tag) > 0):
# The software instance is already under creation but can not be fetched from catalog
# As it is not possible to fetch informations, it is better to raise an error
raise NotImplementedError(tag)
project_portal_type = "Project"
project_list = portal.portal_catalog.portal_catalog(
portal_type=project_portal_type, title=project_title, limit=2)
if len(project_list) == 2:
raise NotImplementedError
elif len(project_list) == 1:
context.REQUEST.set("project_relative_url", project_list[0].getRelativeUrl())
context.REQUEST.set("project_reference", project_list[0].getReference())
else:
module = portal.getDefaultModule(portal_type=project_portal_type)
project = module.newContent(
portal_type=project_portal_type,
title=project_title,
destination_decision_value=person,
activate_kw={'tag': tag}
)
context.REQUEST.set("project_relative_url", project.getRelativeUrl())
context.REQUEST.set("project_reference", project.getReference())
project.approveRegistration()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Person_requestProject</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Person_requestProject</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -19,7 +19,6 @@
<string>destination/portal_workflow/person_slap_interface_workflow/transition_notify</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_compute_node</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_network</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_project</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_site</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_software_instance</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_support</string>
......
......@@ -20,7 +20,6 @@
<string>destination/portal_workflow/person_slap_interface_workflow/transition_notify</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_compute_node</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_network</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_project</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_site</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_software_instance</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_support</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/person_slap_interface_workflow/script_Person_checkConsistency</string>
<string>after_script/portal_workflow/person_slap_interface_workflow/script_Person_requestProject</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_request_project</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Transition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Request Project</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -35,6 +35,7 @@ if invitation_token.getSourceValue() == person:
for assignment in person.objectValues(portal_type="Assignment"):
if assignment.getDestinationProject() == project.getRelativeUrl() and \
assignment.getFunction() == 'customer' and \
assignment.getValidationState() == "open":
invitation_token.invalidate(comment="User already has assignment to the Person")
break
......@@ -43,6 +44,7 @@ if invitation_token.getValidationState() == "validated":
person.newContent(
title="Assigment for Project %s" % project.getTitle(),
portal_type="Assignment",
function='customer',
destination_project_value=project).open()
invitation_token.invalidate()
project = state_change["object"]
from DateTime import DateTime
portal = context.getPortalObject()
if project.getValidationState() != "draft":
return
if project.getReference() in [None, ""]:
raise ValueError("Reference is missing on the Project")
# Get the user id of the context owner.
local_role_list = project.get_local_roles()
for group, role_list in local_role_list:
if 'Owner' in role_list:
user_id = group
break
person = portal.portal_catalog.getResultValue(user_id=user_id)
if person is None:
# Value was created by super user, so there isn't a point on continue
return
for assignment in person.objectValues(portal_type="Assignment"):
if assignment.getDestinationProject() == project.getRelativeUrl():
if assignment.getValidationState() != "open":
assignment.open()
return
person.newContent(
title="Assigment for Project %s" % project.getTitle(),
portal_type="Assignment",
destination_project=project.getRelativeUrl()).open()
project.edit(start_date=DateTime())
project.validate()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Project_approveRegistration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Project_approveRegistration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -6,11 +6,8 @@ person = portal.portal_membership.getAuthenticatedMember().getUserValue()
if person is None:
raise Unauthorized
if project.getDestinationDecision() == person.getRelativeUrl():
project.setDestinationDecision(None)
for assignment in person.objectValues(portal_type="Assignment"):
# Close all user assignments (customer/admin/...) related to this project
if assignment.getDestinationProject() == project.getRelativeUrl() and \
assignment.getValidationState() != 'closed':
assignment.close()
break
......@@ -17,7 +17,6 @@
<value>
<tuple>
<string>destination/portal_workflow/project_slap_interface_workflow/transition_accept_invitation</string>
<string>destination/portal_workflow/project_slap_interface_workflow/transition_approve_registration</string>
<string>destination/portal_workflow/project_slap_interface_workflow/transition_leave_project</string>
</tuple>
</value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Transition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action_name</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/workflow</string>
<string>before_script/portal_workflow/project_slap_interface_workflow/script_Project_checkConsistency</string>
<string>after_script/portal_workflow/project_slap_interface_workflow/script_Project_approveRegistration</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>guard_permission</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>transition_approve_registration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Transition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Approve Registration</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -15,7 +15,6 @@ Instance Node | validation_workflow
Instance Tree | edit_workflow
Instance Tree | instance_slap_interface_workflow
Instance Tree | instance_tree_workflow
Organisation | organisation_slap_interface_workflow
Person | person_slap_interface_workflow
Project | project_slap_interface_workflow
Remote Node | compute_node_slap_interface_workflow
......
......@@ -8,7 +8,6 @@ test.erp5.testSlapOSCloudNetworkSlapInterfaceWorkflow
test.erp5.testSlapOSCloudComputeNodeSlapInterfaceWorkflow
test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow
test.erp5.testSlapOSCloudProjectSlapInterfaceWorkflow
test.erp5.testSlapOSCloudOrganisationSlapInterfaceWorkflow
test.erp5.testSlapOSCloudSecurityGroup
test.erp5.testSlapOSCloudConstraint
test.erp5.testSlapOSCloudUpgrader
......
......@@ -5,7 +5,6 @@ installation_slap_interface_workflow
instance_slap_interface_workflow
instance_tree_workflow
network_slap_interface_workflow
organisation_slap_interface_workflow
person_slap_interface_workflow
project_slap_interface_workflow
slapos_cloud_interaction_workflow
\ 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