[Erp5-report] r11003 - in /erp5/trunk/bt5/erp5_banking_core: SkinTemplateItem/portal_skins/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Oct 30 11:42:15 CET 2006
Author: seb
Date: Mon Oct 30 11:42:09 2006
New Revision: 11003
URL: http://svn.erp5.org?rev=11003&view=rev
Log:
fixed security setting in counter_date workflow
added script in order to know the list of function for an user
add cache in script wich retrieve the list of sites for a particuler user
Added:
erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml
Modified:
erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml
erp5/trunk/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml
Added: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml?rev=11003&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml (added)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedFunctionList.xml Mon Oct 30 11:42:09 2006
@@ -1,0 +1,187 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <tuple>
+ <string>Products.PythonScripts.PythonScript</string>
+ <string>PythonScript</string>
+ </tuple>
+ <none/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Python_magic</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <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>_body</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+# get the current logged user site\n
+\n
+from Products.ERP5Type.Cache import CachingMethod\n
+\n
+if user_id is None:\n
+ user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n
+\n
+def getFunctionList(user_id=user_id):\n
+\n
+ valid_assignment_list = context.Baobab_getUserAssignmentList(user_id=user_id)\n
+\n
+ function_list = []\n
+ for a in valid_assignment_list:\n
+ new_function_list = a.getFunctionList()\n
+ if len(new_function_list)>0:\n
+ function_list.extend(new_function_list)\n
+ return function_list\n
+\n
+getFunctionList = CachingMethod(getFunctionList, id=\'Baobab_getUserAssignedFunctionList\', cache_duration=300)\n
+return getFunctionList()\n
+
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>user_id=None</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>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_code</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>co_argcount</string> </key>
+ <value> <int>1</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>user_id</string>
+ <string>Products.ERP5Type.Cache</string>
+ <string>CachingMethod</string>
+ <string>None</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>getFunctionList</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <none/>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>Baobab_getUserAssignedFunctionList</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml?rev=11003&r1=11002&r2=11003&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_getUserAssignedSiteList.xml Mon Oct 30 11:42:09 2006
@@ -70,14 +70,24 @@
<key> <string>_body</string> </key>
<value> <string># get the current logged user site\n
\n
-valid_assignment_list = context.Baobab_getUserAssignmentList(user_id=user_id)\n
+from Products.ERP5Type.Cache import CachingMethod\n
\n
-site_list = []\n
-for a in valid_assignment_list:\n
- new_site = a.getSite()\n
- if new_site not in (\'\', None):\n
- site_list.append(new_site)\n
-return site_list\n
+if user_id is None:\n
+ user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n
+\n
+def getSiteList(user_id=user_id):\n
+\n
+ valid_assignment_list = context.Baobab_getUserAssignmentList(user_id=user_id)\n
+\n
+ site_list = []\n
+ for a in valid_assignment_list:\n
+ new_site = a.getSite()\n
+ if new_site not in (\'\', None):\n
+ site_list.append(new_site)\n
+ return site_list\n
+\n
+getSiteList = CachingMethod(getSiteList, id=\'Baobab_getUserAssignedSiteList\', cache_duration=300)\n
+return getSiteList(user_id=user_id)\n
</string> </value>
</item>
<item>
@@ -135,14 +145,12 @@
<value>
<tuple>
<string>user_id</string>
+ <string>Products.ERP5Type.Cache</string>
+ <string>CachingMethod</string>
+ <string>None</string>
<string>_getattr_</string>
<string>context</string>
- <string>valid_assignment_list</string>
- <string>site_list</string>
- <string>_getiter_</string>
- <string>a</string>
- <string>new_site</string>
- <string>None</string>
+ <string>getSiteList</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml?rev=11003&r1=11002&r2=11003&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/WorkflowTemplateItem/portal_workflow/counter_date_workflow/states/open.xml Mon Oct 30 11:42:09 2006
@@ -76,6 +76,7 @@
<tuple>
<string>Assignor</string>
<string>Manager</string>
+ <string>Member</string>
</tuple>
</value>
</item>
@@ -94,6 +95,7 @@
<tuple>
<string>Assignor</string>
<string>Manager</string>
+ <string>Member</string>
</tuple>
</value>
</item>
More information about the Erp5-report
mailing list