[Zope-Checkins] SVN: Zope/branches/2.12/src/Products/Five/browser/resource.py Apply some safety to the fix in r110185 after reports it may be causing some problems

Martin Aspeli optilude at gmx.net
Tue Apr 13 10:43:08 EDT 2010


Log message for revision 110799:
  Apply some safety to the fix in r110185 after reports it may be causing some problems

Changed:
  U   Zope/branches/2.12/src/Products/Five/browser/resource.py

-=-
Modified: Zope/branches/2.12/src/Products/Five/browser/resource.py
===================================================================
--- Zope/branches/2.12/src/Products/Five/browser/resource.py	2010-04-13 14:27:23 UTC (rev 110798)
+++ Zope/branches/2.12/src/Products/Five/browser/resource.py	2010-04-13 14:43:07 UTC (rev 110799)
@@ -27,6 +27,7 @@
 from zope.app.publisher.fileresource import File, Image
 from zope.app.publisher.pagetemplateresource import PageTemplate
 
+from Acquisition import aq_base
 from Products.Five.browser import BrowserView
 
 
@@ -164,7 +165,8 @@
         
         # We need to propagate security so that restrictedTraverse() will
         # work
-        resource.__roles__ = self.__roles__
+        if hasattr(aq_base(self), '__roles__'):
+            resource.__roles__ = self.__roles__
         
         return resource
 



More information about the Zope-Checkins mailing list