Commit 802528df authored by Jérome Perrin's avatar Jérome Perrin

don't use getViewPermissionOwner, because it does not return owner if Owner...

don't use getViewPermissionOwner, because it does not return owner if Owner role does not have view permission

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37003 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 56fa04e7
......@@ -55,9 +55,9 @@
<key> <string>_body</string> </key>
<value> <string>"""Returns the name of the owner of current document\n
"""\n
owner = context.getViewPermissionOwner()\n
if owner:\n
found_user_list = context.acl_users.erp5_users.getUserByLogin(owner)\n
owner_id_list = [i[0] for i in context.get_local_roles() if \'Owner\' in i[1]]\n
if owner_id_list:\n
found_user_list = context.acl_users.erp5_users.getUserByLogin(owner_id_list[0])\n
if found_user_list:\n
return found_user_list[0].getTitle()\n
\n
......@@ -98,11 +98,16 @@ return owner\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>owner</string>
<string>found_user_list</string>
<string>i</string>
<string>_getitem_</string>
<string>owner_id_list</string>
<string>found_user_list</string>
<string>owner</string>
</tuple>
</value>
</item>
......
800
\ No newline at end of file
801
\ 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