[Erp5-report] r35755 nicolas - in /erp5/trunk/products/ERP5/Document: File.py TextDocument.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri May 28 18:31:54 CEST 2010
Author: nicolas
Date: Fri May 28 18:31:53 2010
New Revision: 35755
URL: http://svn.erp5.org?rev=35755&view=rev
Log:
Protect getData and getTextContent with same protection
used for conversion. eg. _checkConversionFormatPermission
Modified:
erp5/trunk/products/ERP5/Document/File.py
erp5/trunk/products/ERP5/Document/TextDocument.py
Modified: erp5/trunk/products/ERP5/Document/File.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/File.py?rev=35755&r1=35754&r2=35755&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/File.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/File.py [utf8] Fri May 28 18:31:53 2010
@@ -176,6 +176,7 @@
security.declareProtected(Permissions.AccessContentsInformation, 'getData')
def getData(self, default=None):
"""return Data as str."""
+ self._checkConversionFormatPermission(None)
data = self._baseGetData()
if data is None:
return None
Modified: erp5/trunk/products/ERP5/Document/TextDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TextDocument.py?rev=35755&r1=35754&r2=35755&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TextDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TextDocument.py [utf8] Fri May 28 18:31:53 2010
@@ -356,6 +356,18 @@
self._setBaseContentType(content_type)
return message
+ security.declareProtected(Permissions.AccessContentsInformation,
+ 'getTextContent')
+ def getTextContent(self, default=_MARKER):
+ """Overriden method to check
+ permission to access content in raw format
+ """
+ self._checkConversionFormatPermission(None)
+ if default is _MARKER:
+ return self._baseGetTextContent()
+ else:
+ return self._baseGetTextContent(default)
+
# Backward compatibility for replacement of text_format by content_type
security.declareProtected(Permissions.AccessContentsInformation,
'getTextFormat')
More information about the Erp5-report
mailing list