Commit 50676ced authored by Nicolas Delaby's avatar Nicolas Delaby

Reuse _checkConversionFormatPermission from DocumentMixin

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35750 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4bd23876
......@@ -65,13 +65,7 @@ class DownloadableMixin:
web_cache_kw['format'] = format
_setCacheHeaders(_ViewEmulator().__of__(self), web_cache_kw)
method = self._getTypeBasedMethod('checkConversionFormatPermission',
fallback_script_id='Document_checkConversionFormatPermission')
if not method(format=format):
raise Unauthorized("OOoDocument: user does not have enough permission'\
' to access document in %s format" %\
(format or 'original'))
self._checkConversionFormatPermission(format, **kw)
mime, data = self.convert(format, **kw)
if not format:
# Guess the format from original mimetype
......
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