[Erp5-report] r23243 - in /erp5/trunk/bt5/erp5_banking_core: ActionTemplateItem/portal_type...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Aug 28 16:59:58 CEST 2008
Author: aurel
Date: Thu Aug 28 16:59:55 2008
New Revision: 23243
URL: http://svn.erp5.org?rev=23243&view=rev
Log:
use of a generic script to match a user function with a given string
Added:
erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_matchUserFunction.xml
Modified:
erp5/trunk/bt5/erp5_banking_core/ActionTemplateItem/portal_types/Counter%20Module/container_report.xml
erp5/trunk/bt5/erp5_banking_core/bt/revision
Modified: erp5/trunk/bt5/erp5_banking_core/ActionTemplateItem/portal_types/Counter%20Module/container_report.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/ActionTemplateItem/portal_types/Counter%2520Module/container_report.xml?rev=23243&r1=23242&r2=23243&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/ActionTemplateItem/portal_types/Counter%20Module/container_report.xml (original)
+++ erp5/trunk/bt5/erp5_banking_core/ActionTemplateItem/portal_types/Counter%20Module/container_report.xml Thu Aug 28 16:59:55 2008
@@ -93,11 +93,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
- <value> <string encoding="cdata"><![CDATA[
-
-python: len([x for x in object.Baobab_getFunctionList([\'manager\']) if x in object.Baobab_getUserAssignedFunctionList()])>0
-
-]]></string> </value>
+ <value> <string>python: object.Baobab_matchUserFunction([\'counter\'])</string> </value>
</item>
</dictionary>
</pickle>
Added: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_matchUserFunction.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_matchUserFunction.xml?rev=23243&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_matchUserFunction.xml (added)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Baobab_matchUserFunction.xml Thu Aug 28 16:59:55 2008
@@ -1,0 +1,191 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </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>allow = False\n
+\n
+#context.log(\'group_list\',group_list)\n
+\n
+def match(criterion_list, reference_list):\n
+ for criterion in criterion_list:\n
+ if criterion in reference_list:\n
+ return True\n
+ return False\n
+\n
+if not allow and role_list is not None:\n
+ from AccessControl import getSecurityManager\n
+ roles = getSecurityManager().getUser().getRoles()\n
+ #context.log(\'roles\',roles)\n
+ allow = match(roles, role_list)\n
+\n
+if not allow and group_list is not None:\n
+ user_function_list = context.Baobab_getUserAssignedFunctionList()\n
+ function_list = context.Baobab_getFunctionList(group_list=group_list)\n
+ #context.log(\'user_function_list\',user_function_list)\n
+ #context.log(\'function_list\',function_list)\n
+ allow = match(user_function_list, function_list)\n
+#context.log(\'allow\',allow)\n
+return allow\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>group_list=None, role_list=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>2</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>group_list</string>
+ <string>role_list</string>
+ <string>False</string>
+ <string>allow</string>
+ <string>match</string>
+ <string>None</string>
+ <string>AccessControl</string>
+ <string>getSecurityManager</string>
+ <string>_getattr_</string>
+ <string>roles</string>
+ <string>context</string>
+ <string>user_function_list</string>
+ <string>function_list</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <none/>
+ <none/>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>Baobab_matchUserFunction</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_banking_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/bt/revision?rev=23243&r1=23242&r2=23243&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/bt/revision (original)
+++ erp5/trunk/bt5/erp5_banking_core/bt/revision Thu Aug 28 16:59:55 2008
@@ -1,1 +1,1 @@
-448
+450
More information about the Erp5-report
mailing list