[Erp5-report] r14234 - /erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 25 23:50:23 CEST 2007
Author: ivan
Date: Wed Apr 25 23:50:21 2007
New Revision: 14234
URL: http://svn.erp5.org?rev=14234&view=rev
Log:
Add scipt go get current logged in user's Person object.
Added:
erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.xml
Added: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.xml?rev=14234&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.xml (added)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Site_getAuthenticatedMemberPersonValue.xml Wed Apr 25 23:50:21 2007
@@ -1,0 +1,172 @@
+<?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>"""\n
+ Find and return Person object for current logged in user.\n
+ XXX: if current logged in user is defined in Zope\'s root\n
+ acl_folder script will raise ValueError. \n
+"""\n
+user_name = context.portal_membership.getAuthenticatedMember()\n
+found_user_list = context.portal_catalog(portal_type=\'Person\', \n
+ reference=user_name)\n
+found_users = len(found_user_list)\n
+if found_users != 1:\n
+ # in an ERP5 system there can exists only one unique username\n
+ raise ValueError, "Found %s users for username \'%s\'" %(found_users, user_name)\n
+\n
+return found_user_list[0].getObject()\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></string> </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>0</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>user_name</string>
+ <string>found_user_list</string>
+ <string>len</string>
+ <string>found_users</string>
+ <string>ValueError</string>
+ <string>_getitem_</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>ERP5Site_getAuthenticatedMemberPersonValue</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string>Get current logged in user\'s Person object</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
More information about the Erp5-report
mailing list