[Zope3-checkins] SVN: Zope3/trunk/ Merged from ZopeX3-3.0 branch:

Jim Fulton jim at zope.com
Fri Aug 27 17:28:58 EDT 2004


Log message for revision 27314:
  Merged from ZopeX3-3.0 branch:
  
    r27304 | jim | 2004-08-27 14:20:43 -0400 (Fri, 27 Aug 2004) | 66 lines
  
  Merged from the ZopeX3-3.0-broken branch:
  
    ------------------------------------------------------------------------
    r27300 | srichter | 2004-08-27 12:24:30 -0400 (Fri, 27 Aug 2004) | 3 lines
  
    Gave SkinDocumentation and LayerDocumentation a location upon creation. 
    Now the ftests pass again.
  
    ------------------------------------------------------------------------
    r27299 | jim | 2004-08-27 12:19:47 -0400 (Fri, 27 Aug 2004) | 5 lines
  
    Added logic to set adapter __parent__ attr to allow acquisition of
    grants.
  
    We need to find a way to automate setting adapter __parent__ attrs.
  
    ------------------------------------------------------------------------
    r27298 | jim | 2004-08-27 11:48:28 -0400 (Fri, 27 Aug 2004) | 5 lines
  
    Changed to use the global test manager, who has global grants.
  
    Really, only global users with global grants can use the application
    controller.  This needs some refinement in the future.
  
    ------------------------------------------------------------------------
    r27297 | jim | 2004-08-27 11:48:00 -0400 (Fri, 27 Aug 2004) | 5 lines
  
    Changed to use the global test manager, who has global grants.
  
    Really, only global users with global grants can use the application
    controller.  This needs some refinement in the future.
  
    ------------------------------------------------------------------------
    r27296 | jim | 2004-08-27 11:43:53 -0400 (Fri, 27 Aug 2004) | 5 lines
  
    Changed to use the global test manager, who has global grants.
  
    Really, only global users with global grants can use the application
    controller.  This needs some refinement in the future.
  
    ------------------------------------------------------------------------
    r27295 | jim | 2004-08-27 11:01:18 -0400 (Fri, 27 Aug 2004) | 3 lines
  
    Have annotation security maps parents, so that they can acquire
    permission grants.
  
    ------------------------------------------------------------------------
    r27294 | jim | 2004-08-27 11:01:16 -0400 (Fri, 27 Aug 2004) | 3 lines
  
    Made security-setting attributes public. There's nothing woth
    protecting there.
  
    ------------------------------------------------------------------------
    r27293 | jim | 2004-08-27 10:47:24 -0400 (Fri, 27 Aug 2004) | 44 lines
  
    Removed the global grant for the test manager.  This *should* have no
    effect, since there is a local grant.  But thre are a number of
    protected objects that don't get location information and, thus, can't
    acquire local grants.
  
    This change causes the following 12 tests to fail:
  
    ...
  
  
  


Changed:
  U   Zope3/trunk/ftesting.zcml
  U   Zope3/trunk/src/zope/app/apidoc/viewmodule/__init__.py
  U   Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py
  U   Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py
  U   Zope3/trunk/src/zope/app/copypastemove/__init__.py
  U   Zope3/trunk/src/zope/app/generations/browser/ftests.py
  U   Zope3/trunk/src/zope/app/security/configure.zcml
  U   Zope3/trunk/src/zope/app/securitypolicy/securitymap.py


-=-
Modified: Zope3/trunk/ftesting.zcml
===================================================================
--- Zope3/trunk/ftesting.zcml	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/ftesting.zcml	2004-08-27 21:28:57 UTC (rev 27314)
@@ -26,8 +26,6 @@
       login="mgr"
       password="mgrpw" />
 
-  <grant role="zope.Manager" principal="zope.mgr" />
-
   <!-- Bootstrap principal used to make local grant to the principal above -->
   <principal
       id="zope.globalmgr"

Modified: Zope3/trunk/src/zope/app/apidoc/viewmodule/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/viewmodule/__init__.py	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/src/zope/app/apidoc/viewmodule/__init__.py	2004-08-27 21:28:57 UTC (rev 27314)
@@ -24,6 +24,7 @@
 from zope.app.apidoc.interfaces import IDocumentationModule
 from zope.app.apidoc.utilities import relativizePath
 from zope.app.i18n import ZopeMessageIDFactory as _
+from zope.app.location import locate
 
 # TODO: Temporary hack, since registering an adapter for a particular class is
 # broken.
@@ -112,6 +113,8 @@
                  for reg in service.registrations()
                  if isinstance(reg, SkinRegistration)]
         skins.sort(lambda x, y: cmp(x.name, y.name))
+        # Make sure skins have a location
+        [locate(skin, self, skin.name) for skin in skins]
         return skins
 
 
@@ -151,6 +154,7 @@
     implements(ISkinDocumentation)
 
     def __init__(self, context):
+        self.__parent__ = context
         self.context = context
 
     # See ISkinDocumentation
@@ -184,6 +188,9 @@
             default = LayerRegistration('default',
                                         'This is a predefined layer.')
             layers.append(ILayerDocumentation(default))
+
+        # Make sure skins have a location
+        [locate(layer, self, layer.name) for layer in layers]
         return layers
         
     # See ISkinDocumentation

Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_translationdomaincontrol.py	2004-08-27 21:28:57 UTC (rev 27314)
@@ -23,16 +23,16 @@
     def testDomainOverview(self):
         response = self.publish(
             '/++etc++process/@@TranslationDomain.html',
-            basic='mgr:mgrpw')
+            basic='globalmgr:globalmgrpw')
 
         body = response.getBody()
         self.checkForBrokenLinks(body,
                                  '/++etc++process/@@TranslationDomain.html',
-                                 basic='mgr:mgrpw')
+                                 basic='globalmgr:globalmgrpw')
         
     def testReload(self):
         response = self.publish('/++etc++process/@@TranslationDomain.html',
-                                basic='mgr:mgrpw',
+                                basic='globalmgr:globalmgrpw',
                                 form={'language': u'de',
                                       'domain': u'zope',
                                       'RELOAD': u'Reload'})

Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/ftests/test_zodbcontrol.py	2004-08-27 21:28:57 UTC (rev 27314)
@@ -24,7 +24,7 @@
 
     def testZODBControlOverview(self):
         response = self.publish('/++etc++process/@@ZODBControl.html',
-                                basic='mgr:mgrpw',
+                                basic='globalmgr:globalmgrpw',
                                 form={'days': u'3'})
         body = response.getBody()
         self.assert_('value="3"' in body)

Modified: Zope3/trunk/src/zope/app/copypastemove/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/copypastemove/__init__.py	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/src/zope/app/copypastemove/__init__.py	2004-08-27 21:28:57 UTC (rev 27314)
@@ -161,6 +161,7 @@
 
     def __init__(self, object):
         self.context = object
+        self.__parent__ = object # TODO: see if we can automate this
 
     def moveTo(self, target, new_name=None):
         '''Move this object to the `target` given.
@@ -346,6 +347,7 @@
 
     def __init__(self, object):
         self.context = object
+        self.__parent__ = object # TODO: see if we can automate this
 
     def copyTo(self, target, new_name=None):
         """Copy this object to the `target` given.

Modified: Zope3/trunk/src/zope/app/generations/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/generations/browser/ftests.py	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/src/zope/app/generations/browser/ftests.py	2004-08-27 21:28:57 UTC (rev 27314)
@@ -36,7 +36,7 @@
         ztapi.provideUtility(ISchemaManager, manager, appkey)
 
         response = self.publish('/++etc++process/@@generations.html',
-                                basic='mgr:mgrpw')
+                                basic='globalmgr:globalmgrpw')
         body = response.getBody()
         body = ' '.join(body.split())
         expect = ('<td>zope.app.generations.demo</td> '
@@ -47,7 +47,7 @@
 
         response = self.publish('/++etc++process/@@generations.html'
                                 '?evolve-app-zope.app.generations.demo=evolve',
-                                basic='mgr:mgrpw')
+                                basic='globalmgr:globalmgrpw')
         body = response.getBody()
         body = ' '.join(body.split())
         expect = ('<td>zope.app.generations.demo</td> '
@@ -58,7 +58,7 @@
 
         response = self.publish('/++etc++process/@@generations.html'
                                 '?evolve-app-zope.app.generations.demo=evolve',
-                                basic='mgr:mgrpw')
+                                basic='globalmgr:globalmgrpw')
         body = response.getBody()
         body = ' '.join(body.split())
         expect = ('<td>zope.app.generations.demo</td> '
@@ -69,7 +69,7 @@
 
         response = self.publish('/++etc++process/@@generations.html'
                                 '?evolve-app-zope.app.generations.demo=evolve',
-                                basic='mgr:mgrpw')
+                                basic='globalmgr:globalmgrpw')
         body = response.getBody()
         body = ' '.join(body.split())
         expect = ('<td>zope.app.generations.demo</td> '

Modified: Zope3/trunk/src/zope/app/security/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/security/configure.zcml	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/src/zope/app/security/configure.zcml	2004-08-27 21:28:57 UTC (rev 27314)
@@ -41,7 +41,7 @@
   </content>
 
   <content class=".settings.PermissionSetting">
-    <require permission="zope.Security"
+    <require permission="zope.Public"
              attributes="getName getDescription __str__" />
   </content>
 

Modified: Zope3/trunk/src/zope/app/securitypolicy/securitymap.py
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/securitymap.py	2004-08-27 21:25:31 UTC (rev 27313)
+++ Zope3/trunk/src/zope/app/securitypolicy/securitymap.py	2004-08-27 21:28:57 UTC (rev 27314)
@@ -128,6 +128,7 @@
 class AnnotationSecurityMap(SecurityMap):
 
     def __init__(self, context):
+        self.__parent__ = context
         self._context = context
         annotations = IAnnotations(self._context)
         map = annotations.get(self.key)



More information about the Zope3-Checkins mailing list