[Erp5-report] r12723 - /erp5/trunk/products/ERP5/Document/GeographicAddress.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 15 13:29:57 CET 2007


Author: jerome
Date: Thu Feb 15 13:29:53 2007
New Revision: 12723

URL: http://svn.erp5.org?rev=12723&view=rev
Log:
use AccessContentsInformation to protect methods

Modified:
    erp5/trunk/products/ERP5/Document/GeographicAddress.py

Modified: erp5/trunk/products/ERP5/Document/GeographicAddress.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/GeographicAddress.py?rev=12723&r1=12722&r2=12723&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/GeographicAddress.py (original)
+++ erp5/trunk/products/ERP5/Document/GeographicAddress.py Thu Feb 15 13:29:53 2007
@@ -66,7 +66,7 @@
     # Declarative interfaces
     __implements__ = ( Interface.Coordinate )
 
-    security.declareProtected(Permissions.View, 'asText')
+    security.declareProtected(Permissions.AccessContentsInformation, 'asText')
     def asText(self, country=''):
         """
           Returns the address as a complete formatted string
@@ -80,9 +80,8 @@
           else :
             result = ('%s\n%s %s') % (self.getStreetAddress() or '', 
                           self.getCity() or '', self.getZipCode() or '')
-        # XXX Not very clean
-        if result == "\n ":
-          result = ""
+        if not result.strip():
+          return ''
         return result
 
     security.declareProtected(Permissions.ModifyPortalContent, 'fromText')
@@ -106,9 +105,9 @@
           self.setZipCode(zip_city[0])
           if len(zip_city) > 1:
             self.setCity(string.join(zip_city[1:]))
-#         self.reindexObject()
 
-    security.declareProtected(Permissions.View, 'standardTextFormat')
+    security.declareProtected(Permissions.AccessContentsInformation,
+                              'standardTextFormat')
     def standardTextFormat(self):
         """
           Returns the standard text format for geographic addresses




More information about the Erp5-report mailing list