Commit 1828eaae authored by Aurel's avatar Aurel

update code :

* defined more security on wf state and transition
* remove log

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21347 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 376a5042
......@@ -93,6 +93,14 @@ return \'bank_account_%s\' % (reference, )\n
<key> <string>_params</string> </key>
<value> <string>bank_account</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
......
......@@ -70,7 +70,7 @@
\n
orga_id = "site_%3s" %(site.getCodification())\n
org = context.organisation_module[orga_id]\n
context.log(\'org\',org)\n
\n
return org\n
</string> </value>
</item>
......
......@@ -70,9 +70,8 @@ from Products.ERP5Type.Message import Message\n
\n
object_to_check_list = [context]\n
object_to_check_list.extend(context.getMovementList())\n
context.log("object to check", object_to_check_list)\n
\n
for object in object_to_check_list:\n
context.log("object", object)\n
baobab_source = object.getBaobabSource()\n
baobab_destination = object.getBaobabDestination()\n
\n
......
......@@ -153,9 +153,7 @@ if movement is not None: # case of history\n
# resource_dict[\'simulation_state_title\'] = movement.getTranslatedSimulationStateTitle()\n
# resource_dict[\'explanation_translated_relative_url\'] = "%s/%s" % \\\n
# (explanation_value.getTranslatedPortalType(),source_reference)\n
# context.log("explanation_uid", explanation_uid)\n
catalog_explanation = cache_dict[\'cache_explanation\'][explanation_uid]\n
# context.log("explanation_uid url", catalog_explanation.relative_url)\n
resource_dict[\'explanation_relative_url\'] = catalog_explanation.relative_url\n
source_reference = catalog_explanation.source_reference\n
resource_dict[\'source_reference\'] = catalog_explanation.source_reference\n
......
......@@ -29,6 +29,12 @@
<key> <string>id</string> </key>
<value> <string>cancelled</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cancelled</string> </value>
......@@ -48,4 +54,55 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>AccessContentsInformation</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -64,12 +64,40 @@
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
......
......@@ -38,6 +38,7 @@
<value>
<tuple>
<string>confirm</string>
<string>delete</string>
</tuple>
</value>
</item>
......
......@@ -15,10 +15,85 @@
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cancelled</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cancelled</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="PersistentMapping" module="Persistence.mapping"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>AccessContentsInformation</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -83,7 +83,9 @@
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple/>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
......
......@@ -83,7 +83,9 @@
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple/>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
......
......@@ -67,6 +67,11 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
from DateTime import DateTime\n
\n
\n
exchange_line = state_change[\'object\']\n
\n
# In this script, we will make sure it is impossible to get two \n
......@@ -76,9 +81,6 @@ if exchange_line.getBasePrice() in (None, 0, 0.0):\n
msg = Message(domain = \'ui\', message = \'Sorry, you must define a fixing price.\')\n
raise ValidationFailed, (msg,)\n
\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
from DateTime import DateTime\n
\n
# We have to looking for other currency exchanges lines\n
from Products.ERP5Type.Document import newTempBase\n
......@@ -160,16 +162,16 @@ for line in line_list:\n
<tuple>
<string>state_change</string>
<string>kw</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>DateTime</string>
<string>_getitem_</string>
<string>exchange_line</string>
<string>_getattr_</string>
<string>None</string>
<string>Message</string>
<string>msg</string>
<string>ValidationFailed</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>Products.ERP5Type.Message</string>
<string>DateTime</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>context</string>
......
438
\ No newline at end of file
440
\ 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