[Erp5-report] r37105 ivan - in /erp5/trunk/products/ERP5/Document: Image.py PDFDocument.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 14 10:18:29 CEST 2010


Author: ivan
Date: Wed Jul 14 10:18:28 2010
New Revision: 37105

URL: http://svn.erp5.org?rev=37105&view=rev
Log:
Use respective Permissions constant rather than hard coded string.

Modified:
    erp5/trunk/products/ERP5/Document/Image.py
    erp5/trunk/products/ERP5/Document/PDFDocument.py

Modified: erp5/trunk/products/ERP5/Document/Image.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Image.py?rev=37105&r1=37104&r2=37105&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Image.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Image.py [utf8] Wed Jul 14 10:18:28 2010
@@ -183,7 +183,7 @@ class Image(TextConvertableMixin, File, 
   # Photo display methods
   #
 
-  security.declareProtected('View', 'tag')
+  security.declareProtected(Permissions.View, 'tag')
   def tag(self, display=None, height=None, width=None, cookie=0,
                 alt=None, css_class=None, format=None, quality=DEFAULT_QUALITY,
                 resolution=None, frame=None, **kw):
@@ -243,7 +243,7 @@ class Image(TextConvertableMixin, File, 
   def __str__(self):
     return self.tag()
 
-  security.declareProtected('Access contents information', 'displayIds')
+  security.declareProtected(Permissions.AccessContentsInformation, 'displayIds')
   def displayIds(self, exclude=('thumbnail',)):
     """Return list of display Ids."""
     id_list = list(DEFAULT_DISPLAY_ID_LIST)
@@ -259,7 +259,7 @@ class Image(TextConvertableMixin, File, 
     id_list.sort(key=getSurfaceArea)
     return id_list
 
-  security.declareProtected('Access contents information', 'displayLinks')
+  security.declareProtected(Permissions.AccessContentsInformation, 'displayLinks')
   def displayLinks(self, exclude=('thumbnail',)):
     """Return list of HTML <a> tags for displays."""
     links = []
@@ -267,7 +267,7 @@ class Image(TextConvertableMixin, File, 
         links.append('<a href="%s?display=%s">%s</a>' % (self.REQUEST['URL'], display, display))
     return links
 
-  security.declareProtected('Access contents information', 'displayMap')
+  security.declareProtected(Permissions.AccessContentsInformation, 'displayMap')
   def displayMap(self, exclude=None, format=None, quality=DEFAULT_QUALITY,\
                                                               resolution=None):
     """Return list of displays with size info."""
@@ -345,7 +345,7 @@ class Image(TextConvertableMixin, File, 
     return mime, image.data
 
   # Display
-  security.declareProtected('View', 'index_html')
+  security.declareProtected(Permissions.View, 'index_html')
   @fill_args_from_request('display', 'quality', 'resolution', 'frame')
   def index_html(self, REQUEST, *args, **kw):
     """Return the image data."""
@@ -445,7 +445,7 @@ class Image(TextConvertableMixin, File, 
     """At least see if it *might* be valid."""
     return self.getWidth() and self.getHeight() and self.getData() and self.getContentType()
 
-  security.declareProtected('View', 'getSizeFromImageDisplay')
+  security.declareProtected(Permissions.View, 'getSizeFromImageDisplay')
   def getSizeFromImageDisplay(self, image_display):
     """Return the size for this image display,
        or dimension of this image.
@@ -470,4 +470,3 @@ class Image(TextConvertableMixin, File, 
     """
     File.PUT(self, REQUEST, RESPONSE)
     self._update_image_info()
-

Modified: erp5/trunk/products/ERP5/Document/PDFDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PDFDocument.py?rev=37105&r1=37104&r2=37105&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PDFDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/PDFDocument.py [utf8] Wed Jul 14 10:18:28 2010
@@ -153,7 +153,7 @@ class PDFDocument(Image):
           text += result
       return text
 
-  security.declareProtected('View', 'getSizeFromImageDisplay')
+  security.declareProtected(Permissions.View, 'getSizeFromImageDisplay')
   def getSizeFromImageDisplay(self, image_display):
     """
     Return the size for this image display, or None if this image display name




More information about the Erp5-report mailing list