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

Jim Fulton jim at zope.com
Fri Aug 13 15:15:15 EDT 2004


Log message for revision 27123:
  Merged from ZopeX3-3.0 branch:
  
      r27097 | jim | 2004-08-13 11:01:09 -0400 (Fri, 13 Aug 2004) | 1 line
  
      Removed some unneeded removaAllProxies calls
      ------------------------------------------------------------------------
      r27096 | jim | 2004-08-13 10:57:36 -0400 (Fri, 13 Aug 2004) | 2 lines
  
      Added an explanation, of sorts, for a removeAllProxies call.
  
      ------------------------------------------------------------------------
      r27095 | jim | 2004-08-13 10:27:07 -0400 (Fri, 13 Aug 2004) | 1 line
  
      Removed some unneeded removaAllProxies calls
      ------------------------------------------------------------------------
      r27094 | jim | 2004-08-13 10:22:58 -0400 (Fri, 13 Aug 2004) | 1 line
  
      Removed some unneeded removaAllProxies calls
      ------------------------------------------------------------------------
      r27093 | jim | 2004-08-13 10:22:29 -0400 (Fri, 13 Aug 2004) | 2 lines
  
      Added an explanation, of sorts, for a removeAllProxies call.
  
      ------------------------------------------------------------------------
      r27088 | jim | 2004-08-12 18:25:31 -0400 (Thu, 12 Aug 2004) | 4 lines
  
      Tightened the permission declarations in zope.app.rdb.
  
      This required refactoring some of the interfaces a bit.
  
      ------------------------------------------------------------------------
      r27086 | jim | 2004-08-12 16:46:50 -0400 (Thu, 12 Aug 2004) | 3 lines
  
      Tightened up permission declarations in many places where there were
      too loose.
  
  


Changed:
  U   Zope3/trunk/src/zope/app/adapter/adapter.py
  U   Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/classmodule/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/ifacemodule/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/servicemodule/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/utilitymodule/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/viewmodule/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/zcmlmodule/configure.zcml
  U   Zope3/trunk/src/zope/app/appsetup/bootstrap.py
  U   Zope3/trunk/src/zope/app/cache/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/cache/configure.zcml
  U   Zope3/trunk/src/zope/app/errorservice/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/ftp/configure.zcml
  U   Zope3/trunk/src/zope/app/introspector/configure.zcml
  U   Zope3/trunk/src/zope/app/location/location.py
  U   Zope3/trunk/src/zope/app/onlinehelp/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/onlinehelp/configure.zcml
  U   Zope3/trunk/src/zope/app/principalannotation/configure.zcml
  U   Zope3/trunk/src/zope/app/rdb/__init__.py
  U   Zope3/trunk/src/zope/app/rdb/browser/__init__.py
  U   Zope3/trunk/src/zope/app/rdb/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/rdb/browser/gadflyda.zcml
  U   Zope3/trunk/src/zope/app/rdb/browser/rdb.py
  U   Zope3/trunk/src/zope/app/rdb/configure.zcml
  U   Zope3/trunk/src/zope/app/rdb/gadflyda.zcml
  U   Zope3/trunk/src/zope/app/rdb/gadflymeta.py
  U   Zope3/trunk/src/zope/app/rdb/interfaces.py
  U   Zope3/trunk/src/zope/app/registration/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/registration/configure.zcml
  U   Zope3/trunk/src/zope/app/site/service.py
  U   Zope3/trunk/src/zope/app/utility/browser/__init__.py
  U   Zope3/trunk/src/zope/app/utility/utility.py
  U   Zope3/trunk/src/zope/server/ftp/README.txt


-=-
Modified: Zope3/trunk/src/zope/app/adapter/adapter.py
===================================================================
--- Zope3/trunk/src/zope/app/adapter/adapter.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/adapter/adapter.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -159,6 +159,13 @@
             for key, stack in stacks.iteritems():
                 registration = stack.active()
                 if registration is not None:
+
+                    # Needs more thought:
+                    # We have to remove the proxy because we're
+                    # storing the value amd we can't store proxies.
+                    # (Why can't we?)  we need to think more about
+                    # why/if this is truly safe
+                    
                     radapters[key] = removeAllProxies(registration.factory)
 
     def adaptersChanged(self, *args):

Modified: Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -29,7 +29,7 @@
   <pages
     for="zope.app.apidoc.APIDocumentation"
     class=".apidoc.APIDocumentationView"
-    permission="zope.View">
+    permission="zope.app.apidoc.UseAPIDoc">
 
     <page
         name="index.html"

Modified: Zope3/trunk/src/zope/app/apidoc/classmodule/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/classmodule/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/classmodule/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -31,28 +31,28 @@
 
   <browser:page
     for=".ClassModule"
-    permission="zope.View"
+    permission="zope.app.apidoc.UseAPIDoc"
     class=".browser.Menu"
     name="menu.html"
     template="menu.pt" />
 
   <browser:page
     for=".IModuleDocumentation"
-    permission="zope.View"
+    permission="zope.app.apidoc.UseAPIDoc"
     class=".browser.ModuleDetails"
     name="index.html"
     template="module_index.pt" />
 
   <browser:page
     for=".IClassDocumentation"
-    permission="zope.View"
+    permission="zope.app.apidoc.UseAPIDoc"
     class=".browser.ClassDetails"
     name="index.html"
     template="class_index.pt" />
 
   <browser:page
     for=".IFunctionDocumentation"
-    permission="zope.View"
+    permission="zope.app.apidoc.UseAPIDoc"
     class=".browser.FunctionDetails"
     name="index.html"
     template="function_index.pt" />

Modified: Zope3/trunk/src/zope/app/apidoc/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -2,6 +2,11 @@
   xmlns="http://namespaces.zope.org/zope"
   i18n_domain="zope">
 
+  <permission
+      id="zope.app.apidoc.UseAPIDoc"
+      title="[zope.app.apidoc.UseAPIDoc] Access Online API documentation"
+      />
+
   <class class=".APIDocumentation">
     <require
         interface="zope.app.container.interfaces.IReadContainer"

Modified: Zope3/trunk/src/zope/app/apidoc/ifacemodule/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/ifacemodule/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/ifacemodule/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -19,7 +19,7 @@
 
   <browser:page
       for="zope.interface.interfaces.IInterface"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.InterfaceDetails"
       name="apiindex.html"
       template="index.pt"
@@ -35,7 +35,7 @@
 
   <browser:page
       for=".InterfaceModule"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".menu.Menu"
       name="menu.html"
       template="menu.pt"

Modified: Zope3/trunk/src/zope/app/apidoc/servicemodule/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/servicemodule/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/servicemodule/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -20,7 +20,7 @@
 
   <browser:page
       for=".ServiceModule"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.Menu"
       name="menu.html"
       template="menu.pt"
@@ -28,7 +28,7 @@
 
   <browser:page
       for=".Service"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.ServiceDetails"
       name="index.html"
       template="index.pt"

Modified: Zope3/trunk/src/zope/app/apidoc/utilitymodule/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/utilitymodule/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/utilitymodule/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -23,14 +23,14 @@
 
   <browser:page
       for=".UtilityModule"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.Menu"
       name="menu.html"
       template="menu.pt" />
 
   <browser:page
       for=".Utility"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.UtilityDetails"
       name="index.html"
       template="index.pt" />

Modified: Zope3/trunk/src/zope/app/apidoc/viewmodule/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/viewmodule/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/viewmodule/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -34,21 +34,21 @@
 
   <browser:page
       for=".ViewModule"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.Menu"
       name="menu.html"
       template="menu.pt" />
 
   <browser:page
       for=".ViewModule"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.SkinLayer"
       name="skin_layer.html"
       template="skin_layer.pt" />
 
   <browser:page
       for=".ViewModule"
-      permission="zope.View"
+      permission="zope.app.apidoc.UseAPIDoc"
       class=".browser.ViewsDetails"
       name="index.html"
       template="index.pt" />

Modified: Zope3/trunk/src/zope/app/apidoc/zcmlmodule/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/zcmlmodule/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/apidoc/zcmlmodule/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -24,14 +24,14 @@
   <browser:page
     for=".ZCMLModule"
     class=".browser.Menu"
-    permission="zope.View"
+    permission="zope.app.apidoc.UseAPIDoc"
     name="menu.html"
     template="menu.pt" />
 
   <browser:page
     for=".Directive"
     class=".browser.DirectiveDetails"
-    permission="zope.View"
+    permission="zope.app.apidoc.UseAPIDoc"
     name="index.html"
     template="index.pt" />
 

Modified: Zope3/trunk/src/zope/app/appsetup/bootstrap.py
===================================================================
--- Zope3/trunk/src/zope/app/appsetup/bootstrap.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/appsetup/bootstrap.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -24,7 +24,6 @@
 from transaction import get_transaction
 from zope.app.publication.zopepublication import ZopePublication
 from zope.interface import implements
-from zope.proxy import removeAllProxies
 from zope.component.exceptions import ComponentLookupError
 
 from zope.app import zapi
@@ -100,7 +99,6 @@
             return None
         name = object_name
         obj = object_factory()
-        obj = removeAllProxies(obj)
         package[name] = obj
         return name
 
@@ -186,7 +184,6 @@
     package = getServiceManagerDefault(root_folder)
     chooser = INameChooser(package)
     service = service_factory()
-    service = removeAllProxies(service)
     name = chooser.chooseName(service_type, service)
     package[name] = service
 

Modified: Zope3/trunk/src/zope/app/cache/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/cache/browser/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/cache/browser/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -19,7 +19,7 @@
   <pages
       for="zope.app.cache.interfaces.ram.IRAMCache"
       class="zope.app.cache.browser.ram.RAMCacheView"
-      permission="zope.Public">
+      permission="zope.ManageServices">
     <page name="editAction.html" attribute="action" />
     <page name="index.html" template="ramedit.pt" 
           menu="zmi_views" title="Edit"/>

Modified: Zope3/trunk/src/zope/app/cache/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/cache/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/cache/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -26,7 +26,7 @@
         />
 
     <require 
-        permission="zope.Public" 
+        permission="zope.ManageServices" 
         interface="zope.app.cache.interfaces.ram.IRAMCache"
         />
   </content>

Modified: Zope3/trunk/src/zope/app/errorservice/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/errorservice/browser/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/errorservice/browser/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -20,7 +20,7 @@
 
   <pages
       for="zope.app.errorservice.interfaces.IErrorReportingService"
-      permission="zope.Public"
+      permission="zope.ManageServices"
       class=".EditErrorLog">
 
     <page name="index.html" template="error.pt"

Modified: Zope3/trunk/src/zope/app/ftp/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/ftp/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/ftp/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -1,5 +1,13 @@
 <configure xmlns='http://namespaces.zope.org/zope'>
 
+  <!-- Note that the views ehere are public because
+
+       - They are generic
+
+       - Protection is provided by the security proxies around their contexts.
+
+    -->
+  
   <view 
       for="zope.app.container.interfaces.IReadContainer"
       type="zope.publisher.interfaces.ftp.IFTPRequest"

Modified: Zope3/trunk/src/zope/app/introspector/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/introspector/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/introspector/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -3,10 +3,21 @@
     xmlns:browser="http://namespaces.zope.org/browser"
     >
 
+  <permission
+      id="zope.app.introspector.Introspect"
+      title=
+  "[zope.app.introspector.Introspect] Introspect Object Classes and Interfaces"
+      description="
+      Use the object-introspection facility to discover
+      and browse interfaces and classes.
+      "
+      />
+
+
   <adapter
       for='*'
       factory="zope.app.introspector.Introspector"
-      permission="zope.View"
+      permission="zope.app.introspector.Introspect"
       provides="zope.app.introspector.interfaces.IIntrospector"
       />
 
@@ -24,7 +35,7 @@
 
   <browser:pages
       for="zope.interface.Interface"
-      permission="zope.ManageServices"
+      permission="zope.app.introspector.Introspect"
       class="zope.app.introspector.browser.IntrospectorView"
       >
 
@@ -42,7 +53,7 @@
   <browser:page
       name="index.html"
       for="zope.interface.interfaces.IInterface"
-      permission="zope.View"
+      permission="zope.app.introspector.Introspect"
       template="introspector.pt"
       class="zope.app.introspector.browser.IntrospectorView"
       />

Modified: Zope3/trunk/src/zope/app/location/location.py
===================================================================
--- Zope3/trunk/src/zope/app/location/location.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/location/location.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -19,7 +19,6 @@
 
 import zope.interface
 from zope.app.location.interfaces import ILocation
-from zope.proxy import removeAllProxies
 from zope.proxy import ProxyBase, getProxiedObject
 from zope.app.decorator import DecoratorSpecificationDescriptor
 from zope.app.decorator import DecoratedSecurityCheckerDescriptor
@@ -68,7 +67,6 @@
     sets attributes that are normally unsettable.
     """
 
-    object = removeAllProxies(object)
     object.__parent__ = parent
     object.__name__ = name
 

Modified: Zope3/trunk/src/zope/app/onlinehelp/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/onlinehelp/browser/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/onlinehelp/browser/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -11,7 +11,7 @@
 
   <pages
       for="zope.app.onlinehelp.interfaces.IOnlineHelpTopic"
-      permission="zope.Public"
+      permission="zope.View"
       class=".OnlineHelpTopicView"
       >
 
@@ -22,7 +22,7 @@
 
   <page
       for="zope.app.onlinehelp.interfaces.IOnlineHelp"
-      permission="zope.Public"
+      permission="zope.View"
       class=".ContextHelpView"
       name="contexthelp.html" 
       template="contexthelp.pt" />

Modified: Zope3/trunk/src/zope/app/onlinehelp/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/onlinehelp/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/onlinehelp/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -21,7 +21,7 @@
   <!-- Setup OnlineHelp Root as a Utility -->
   <utility
       provides=".interfaces.IOnlineHelp"
-      permission="zope.Public"
+      permission="zope.View"
       component="zope.app.onlinehelp.help"
       name="OnlineHelp" />
 

Modified: Zope3/trunk/src/zope/app/principalannotation/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/principalannotation/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/principalannotation/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -12,7 +12,7 @@
         id="zope.app.PrincipalAnnotationService"
         />
     <require
-        permission="zope.Public"
+        permission="zope.View"
         interface=".interfaces.IPrincipalAnnotationService"
         />
     </content>

Modified: Zope3/trunk/src/zope/app/rdb/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/__init__.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/__init__.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -36,7 +36,9 @@
 from zope.app.rdb.interfaces import DatabaseException
 from zope.app.rdb.interfaces import IResultSet
 from zope.app.rdb.interfaces import IZopeConnection, IZopeCursor
-from zope.app.rdb.interfaces import IZopeDatabaseAdapter, ISQLCommand
+from zope.app.rdb.interfaces import ISQLCommand
+from zope.app.rdb.interfaces import IManageableZopeDatabaseAdapter
+from zope.app.rdb.interfaces import IZopeDatabaseAdapter
 from zope.app.rdb.interfaces import IGlobalConnectionService
 
 
@@ -108,7 +110,7 @@
 
 class ZopeDatabaseAdapter(Persistent, Contained):
 
-    implements(IZopeDatabaseAdapter)
+    implements(IManageableZopeDatabaseAdapter)
     _v_connection =  None
 
     def __init__(self, dsn):
@@ -119,16 +121,13 @@
         conn_info = parseDSN(self.dsn)
 
     def setDSN(self, dsn):
-        'See IZopeDatabaseAdapter'
         assert dsn.startswith('dbi://'), "The DSN has to start with 'dbi://'"
         self.dsn = dsn
 
     def getDSN(self):
-        'See IZopeDatabaseAdapter'
         return self.dsn
 
     def connect(self):
-        'See IZopeDatabaseAdapter'
         if not self.isConnected():
             try:
                 self._v_connection = ZopeConnection(
@@ -142,18 +141,15 @@
 
 
     def disconnect(self):
-        'See IZopeDatabaseAdapter'
         if self.isConnected():
             self._v_connection.close()
             self._v_connection = None
 
     def isConnected(self):
-        'See IZopeDatabaseAdapter'
         return hasattr(self, '_v_connection') and \
                self._v_connection is not None
 
     def __call__(self):
-        'See IZopeDatabaseAdapter'
         self.connect()
         return self._v_connection
 

Modified: Zope3/trunk/src/zope/app/rdb/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/browser/__init__.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/browser/__init__.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -1,47 +1 @@
-##############################################################################
 #
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Zope database adapter views
-
-$Id$
-"""
-from zope.proxy import removeAllProxies
-
-from zope.app.rdb.interfaces import IZopeDatabaseAdapter
-from zope.app.rdb import queryForResults
-
-class TestSQL(object):
-
-    __used_for__ = IZopeDatabaseAdapter
-
-    def getTestResults(self):
-        sql = self.request.form['sql']
-        adapter = removeAllProxies(self.context)
-        result = queryForResults(adapter(), sql)
-        return result
-
-
-class Connection(object):
-    __used_for__ = IZopeDatabaseAdapter
-
-    def edit(self, dsn):
-        self.context.setDSN(dsn)
-        return self.request.response.redirect(self.request.URL[-1])
-
-    def connect(self):
-        self.context.connect()
-        return self.request.response.redirect(self.request.URL[-1])
-
-    def disconnect(self):
-        self.context.disconnect()
-        return self.request.response.redirect(self.request.URL[-1])

Modified: Zope3/trunk/src/zope/app/rdb/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/rdb/browser/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/browser/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -17,12 +17,12 @@
       name="+"
       for="zope.app.rdb.interfaces.IZopeDatabaseAdapter"
       class="zope.app.container.browser.adding.Adding" 
-      permission="zope.ManageContent" />
+      permission="zope.ManageServices" />
 
   <pages
-      for="zope.app.rdb.interfaces.IZopeDatabaseAdapter"
-      permission="zope.View"
-      class=".Connection">
+      for="zope.app.rdb.interfaces.IManageableZopeDatabaseAdapter"
+      permission="zope.ManageServices"
+      class=".rdb.Connection">
 
     <page name="editForm.html" template="rdbconnection.pt" 
           menu="zmi_views" title="Edit"/>
@@ -33,8 +33,8 @@
   </pages>
 
   <pages
-      for="zope.app.rdb.interfaces.IZopeDatabaseAdapter"
-      permission="zope.View"
+      for="zope.app.rdb.interfaces.IManageableZopeDatabaseAdapter"
+      permission="zope.ManageServices"
       class=".rdb.TestSQL">
     <page name="testForm.html" template="rdbtestsql.pt"
           menu="zmi_views" title="[test-page-title] Test"/>
@@ -43,12 +43,12 @@
   </pages>
 
   <defaultView 
-      for="zope.app.rdb.interfaces.IZopeDatabaseAdapter"
+      for="zope.app.rdb.interfaces.IManageableZopeDatabaseAdapter"
       name="editForm.html" />
 
   <addform
       label="Add Database Connection Registration"
-      for="zope.app.rdb.interfaces.IZopeDatabaseAdapter"
+      for="zope.app.rdb.interfaces.IManageableZopeDatabaseAdapter"
       name="addRegistration.html"
       schema="zope.app.utility.interfaces.IUtilityRegistration"
       class="zope.app.utility.browser.AddRegistration"

Modified: Zope3/trunk/src/zope/app/rdb/browser/gadflyda.zcml
===================================================================
--- Zope3/trunk/src/zope/app/rdb/browser/gadflyda.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/browser/gadflyda.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -4,7 +4,7 @@
 
   <addform
       name="AddGadflyDA"
-      schema="zope.app.rdb.interfaces.IZopeDatabaseAdapter"
+      schema="zope.app.rdb.interfaces.IManageableZopeDatabaseAdapter"
       label="Add Gadfly Database Adapter"
       content_factory="zope.app.rdb.gadflyda.GadflyAdapter"
       arguments="dsn"

Modified: Zope3/trunk/src/zope/app/rdb/browser/rdb.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/browser/rdb.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/browser/rdb.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -15,24 +15,21 @@
 
 $Id$
 """
-from zope.proxy import removeAllProxies
-
-from zope.app.rdb.interfaces import IZopeDatabaseAdapter
+from zope.app.rdb.interfaces import IManageableZopeDatabaseAdapter
 from zope.app.rdb import queryForResults
 
 class TestSQL(object):
 
-    __used_for__ = IZopeDatabaseAdapter
+    __used_for__ = IManageableZopeDatabaseAdapter
 
     def getTestResults(self):
         sql = self.request.form['sql']
-        adapter = removeAllProxies(self.context)
-        result = queryForResults(adapter(), sql)
+        result = queryForResults(self.context(), sql)
         return result
 
 
 class Connection(object):
-    __used_for__ = IZopeDatabaseAdapter
+    __used_for__ = IManageableZopeDatabaseAdapter
 
     def edit(self, dsn):
         self.context.setDSN(dsn)

Modified: Zope3/trunk/src/zope/app/rdb/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/rdb/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -3,6 +3,11 @@
     i18n_domain="zope"
     >
 
+  <permission
+      id="zope.app.rdb.Use"
+      title="[zope.app.rdb.Use] Use Database Connections"
+      />
+
   <content class="zope.app.rdb.ZopeConnection">
     <require
         permission="zope.ManageContent"
@@ -27,16 +32,13 @@
   <content class="zope.app.rdb.ZopeDatabaseAdapter">
 
     <implements
-        interface="zope.app.rdb.interfaces.IZopeDatabaseAdapter" />
-
-    <implements
         interface="zope.app.annotation.interfaces.IAttributeAnnotatable" />
 
     <implements
       interface="zope.app.utility.interfaces.ILocalUtility" />
 
     <require
-        permission="zope.Public"
+        permission="zope.app.rdb.Use"
         interface="zope.app.rdb.interfaces.IZopeDatabaseAdapter" />
 
   </content>

Modified: Zope3/trunk/src/zope/app/rdb/gadflyda.zcml
===================================================================
--- Zope3/trunk/src/zope/app/rdb/gadflyda.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/gadflyda.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -4,8 +4,11 @@
     <factory
         title="Gadfly Database Adapter" />
     <require
-        permission="zope.Public"
+        permission="zope.app.rdb.Use"
         interface="zope.app.rdb.interfaces.IZopeDatabaseAdapter" />
+    <require
+        permission="zope.ManageServices"
+        interface="zope.app.rdb.interfaces.IZopeDatabaseAdapterManagement" />
   </content>
 
 </configure>

Modified: Zope3/trunk/src/zope/app/rdb/gadflymeta.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/gadflymeta.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/gadflymeta.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -19,7 +19,6 @@
 from zope.interface import Interface
 
 from zope.app import zapi
-from zope.app.rdb.interfaces import IZopeDatabaseAdapter
 from zope.app.rdb.gadflyda import setGadflyRoot 
 
 class IGadflyRoot(Interface):

Modified: Zope3/trunk/src/zope/app/rdb/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/interfaces.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/rdb/interfaces.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -379,6 +379,15 @@
 
     This object is internal to the connection service."""
 
+    def isConnected():
+        """Check whether the Zope Connection is actually connected to the
+        database."""
+
+    def __call__():
+        """Return an IZopeConnection object"""
+
+class IZopeDatabaseAdapterManagement(Interface):
+
     def setDSN(dsn):
         """Set the DSN for the Adapter instance"""
 
@@ -406,14 +415,12 @@
     def disconnect():
         """Disconnect from the database."""
 
-    def isConnected():
-        """Check whether the Zope Connection is actually connected to the
-        database."""
+class IManageableZopeDatabaseAdapter(IZopeDatabaseAdapter,
+                                     IZopeDatabaseAdapterManagement):
+    """Database adapters with management functions
+    """
 
-    def __call__():
-        """Return an IZopeConnection object"""
 
-
 class IZopeConnection(IDBIConnection, IDBITypeInfoProvider):
 
     # An implementation of this object will be exposed to the

Modified: Zope3/trunk/src/zope/app/registration/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/registration/browser/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/registration/browser/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -55,14 +55,14 @@
       for="
       zope.app.registration.interfaces.INoRegistrationManagerError"
       name="index.html"
-      permission="zope.Public"
+      permission="zope.ManageServices"
       template="../../exception/browser/user.pt"
       class="zope.app.exception.browser.user.UserErrorView" />
 
   <page
       for="zope.app.registration.interfaces.INoLocalServiceError"
       name="index.html"
-      permission="zope.Public"
+      permission="zope.ManageServices"
       template="../../exception/browser/user.pt"
       class="zope.app.exception.browser.user.UserErrorView" />
 

Modified: Zope3/trunk/src/zope/app/registration/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/registration/configure.zcml	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/registration/configure.zcml	2004-08-13 19:15:14 UTC (rev 27123)
@@ -39,7 +39,7 @@
         id="zope.app.services.RegistrationManager"
         title="Registration Manager" />
     <require
-        permission="zope.View"
+        permission="zope.ManageServices"
         interface="zope.app.container.interfaces.IReadContainer" />
     <require
         permission="zope.ManageServices"

Modified: Zope3/trunk/src/zope/app/site/service.py
===================================================================
--- Zope3/trunk/src/zope/app/site/service.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/site/service.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -31,7 +31,6 @@
 
 import zope.interface
 from zope.component.exceptions import ComponentLookupError
-from zope.proxy import removeAllProxies
 
 import zope.app.registration.interfaces
 from zope.app import zapi
@@ -251,7 +250,7 @@
 
     def findModule(self, name):
         # override to pass call up to next service manager
-        mod = super(ServiceManager, removeAllProxies(self)).findModule(name)
+        mod = super(ServiceManager, self).findModule(name)
         if mod is not None:
             return mod
 

Modified: Zope3/trunk/src/zope/app/utility/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/utility/browser/__init__.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/utility/browser/__init__.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -21,7 +21,6 @@
 from zope.app.registration.interfaces import UnregisteredStatus
 from zope.app import zapi
 from zope.interface import providedBy
-from zope.proxy import removeAllProxies
 from zope.security.proxy import trustedRemoveSecurityProxy
 from zope.app.introspector import interfaceToName
 
@@ -42,7 +41,6 @@
 
 
 class Utilities(object):
-
     # self.context is the local utility service
 
     def update(self):
@@ -150,7 +148,7 @@
         return s
 
     def getConfigs(self):
-        utils = removeAllProxies(self.context)
+        utils = self.context
         L = []
         for registration in utils.registrations(localOnly=True):
             ifname = interfaceToName(self.context, registration.provided)

Modified: Zope3/trunk/src/zope/app/utility/utility.py
===================================================================
--- Zope3/trunk/src/zope/app/utility/utility.py	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/app/utility/utility.py	2004-08-13 19:15:14 UTC (rev 27123)
@@ -70,6 +70,13 @@
                 registration = stack.active()
                 if registration is not None:
                     key = True, key[1], '', key[3]
+
+                    # Needs more thought:
+                    # We have to remove the proxy because we're
+                    # storing the value amd we can't store proxies.
+                    # (Why can't we?)  we need to think more about
+                    # why/if this is truly safe
+                    
                     radapters[key] = radapters.get(key, ()) + (
                         removeAllProxies(registration.factory), )
 

Modified: Zope3/trunk/src/zope/server/ftp/README.txt
===================================================================
--- Zope3/trunk/src/zope/server/ftp/README.txt	2004-08-13 19:11:22 UTC (rev 27122)
+++ Zope3/trunk/src/zope/server/ftp/README.txt	2004-08-13 19:15:14 UTC (rev 27123)
@@ -4,7 +4,7 @@
   framework.
 
   The core server is implemented in server.py. This relies on a
-  file-system abstraction, defined in zope.server.interface.ft.
+  file-system abstraction, defined in zope.server.interfaces.py.
 
   The publisher module provides the connection to the object
   publsihing system by providing a file-system implementation that



More information about the Zope3-Checkins mailing list