[Zope-Checkins] CVS: Zope/lib/python/webdav - Collection.py:1.25 Resource.py:1.56 davcmds.py:1.21

Lennart Regebro regebro at nuxeo.com
Tue Oct 21 10:49:49 EDT 2003


Update of /cvs-repository/Zope/lib/python/webdav
In directory cvs.zope.org:/tmp/cvs-serv9824/lib/python/webdav

Modified Files:
	Collection.py Resource.py davcmds.py 
Log Message:
Collector #572: WebDAV GET protected by 'FTP Access' permission.
Two new methods have been added to WebDAV resources, "manage_DAVget"
and "listDAVObjects". These are now used by WebDAV instead of the
earlier "manage_FTPget" and "objectValues". This separates the
permissions, and allows WebDAV specific overriding of these methods.



=== Zope/lib/python/webdav/Collection.py 1.24 => 1.25 ===
--- Zope/lib/python/webdav/Collection.py:1.24	Wed Aug 14 18:11:40 2002
+++ Zope/lib/python/webdav/Collection.py	Tue Oct 21 10:49:48 2003
@@ -127,5 +127,13 @@
 
         return RESPONSE
 
+    def listDAVObjects(self):
+        objectValues = getattr(self, 'objectValues', None)
+        if objectValues is not None:
+            return objectValues()
+        return []
+        
+
+
 
 Globals.default__class_init__(Collection)


=== Zope/lib/python/webdav/Resource.py 1.55 => 1.56 ===
--- Zope/lib/python/webdav/Resource.py:1.55	Mon Feb  3 05:59:54 2003
+++ Zope/lib/python/webdav/Resource.py	Tue Oct 21 10:49:48 2003
@@ -42,7 +42,8 @@
 
     __ac_permissions__=(
         ('View',                             ('HEAD',)),
-        ('WebDAV access',                    ('PROPFIND',),
+        ('WebDAV access',                    ('PROPFIND', 'manage_DAVget',
+                                              'listDAVObjects'),
          ('Authenticated', 'Manager')),
         ('Manage properties',                ('PROPPATCH',)),
         ('Delete objects',                   ('DELETE',)),
@@ -550,4 +551,11 @@
         return RESPONSE
 
 
+    def manage_DAVget(self):
+        return self.manage_FTPget(self)
+
+    def listDAVObjects(self):
+        return []
+
+        
 Globals.default__class_init__(Resource)


=== Zope/lib/python/webdav/davcmds.py 1.20 => 1.21 ===
--- Zope/lib/python/webdav/davcmds.py:1.20	Wed Aug 14 18:11:40 2002
+++ Zope/lib/python/webdav/davcmds.py	Tue Oct 21 10:49:48 2003
@@ -141,7 +141,7 @@
         else: raise 'Bad Request', 'Invalid request'
         result.write('</d:response>\n')
         if depth in ('1', 'infinity') and iscol:
-            for ob in obj.objectValues():
+            for ob in obj.listDAVObjects():
                 if hasattr(ob,"meta_type"):
                     if ob.meta_type=="Broken Because Product is Gone": continue
                 dflag=hasattr(ob, '_p_changed') and (ob._p_changed == None)




More information about the Zope-Checkins mailing list