Commit d6389efd authored by Ivan Tyagov's avatar Ivan Tyagov

Make it possible to get Person object by explicitly specifing user name (i.e reference).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14587 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 191a4f28
...@@ -73,7 +73,8 @@ ...@@ -73,7 +73,8 @@
XXX: if current logged in user is defined in Zope\'s root\n XXX: if current logged in user is defined in Zope\'s root\n
acl_folder script will raise ValueError. \n acl_folder script will raise ValueError. \n
"""\n """\n
user_name = context.portal_membership.getAuthenticatedMember()\n if user_name is None:\n
user_name = context.portal_membership.getAuthenticatedMember()\n
found_user_list = context.portal_catalog(portal_type=\'Person\', \n found_user_list = context.portal_catalog(portal_type=\'Person\', \n
reference=user_name)\n reference=user_name)\n
found_users = len(found_user_list)\n found_users = len(found_user_list)\n
...@@ -104,7 +105,7 @@ return found_user_list[0].getObject()\n ...@@ -104,7 +105,7 @@ return found_user_list[0].getObject()\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>user_name = None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -124,15 +125,16 @@ return found_user_list[0].getObject()\n ...@@ -124,15 +125,16 @@ return found_user_list[0].getObject()\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>user_name</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>user_name</string>
<string>found_user_list</string> <string>found_user_list</string>
<string>len</string> <string>len</string>
<string>found_users</string> <string>found_users</string>
...@@ -149,7 +151,9 @@ return found_user_list[0].getObject()\n ...@@ -149,7 +151,9 @@ return found_user_list[0].getObject()\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple>
<none/> <none/>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
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