Commit 9ff86dd7 authored by Jérome Perrin's avatar Jérome Perrin

Document_checkConversionFormatPermission: make sure Owner can get his own...

Document_checkConversionFormatPermission: make sure Owner can get his own document in original format
Document_convert: honor getSourceReference to set the returned filename



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17137 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 86b26fc3
......@@ -76,7 +76,7 @@ role_list = user.getRolesInContext(context)\n
\n
# Users involved in the document may view it in editable mode\n
if "Associate" in role_list or "Assignee" in role_list or\\\n
"Assignor" in role_list or "Manager" in role_list:\n
"Assignor" in role_list or "Manager" in role_list or "Owner" in role_list:\n
return 1\n
\n
# Reject original format\n
......
......@@ -79,7 +79,13 @@ response = request.RESPONSE\n
data = context.index_html(request, response, format=format, force=force)\n
typ = response.headers.get(\'content-type\')\n
\n
filename = \'%s.%s\' % ((filename or context.title_or_id(), format))\n
if not filename:\n
filename = context.getSourceReference()\n
if filename and \'.\' in filename:\n
filename = filename[:filename.rindex(\'.\')]\n
else:\n
filename = context.title_or_id()\n
filename = \'%s.%s\' % ((filename, format))\n
if typ == \'application/zip\':\n
filename += \'.zip\'\n
\n
......
697
\ No newline at end of file
698
\ 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