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