[Zope-Checkins] CVS: Zope/lib/python/webdav - Collection.py:1.24.82.1 Resource.py:1.55.26.1 davcmds.py:1.20.82.1

Lennart Regebro regebro at nuxeo.com
Tue Oct 21 09:51:52 EDT 2003


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

Modified Files:
      Tag: regebro-webdavfixes-branch
	Collection.py Resource.py davcmds.py 
Log Message:
Two bugs fixed: 
#572, getting something via WebDAV requires 'FPT Access' permission.

Separated the listing of resources in a collection in WebDAV from the objectValues() method to the listDAVObjects() method.




=== Zope/lib/python/webdav/Collection.py 1.24 => 1.24.82.1 ===
--- Zope/lib/python/webdav/Collection.py:1.24	Wed Aug 14 18:11:40 2002
+++ Zope/lib/python/webdav/Collection.py	Tue Oct 21 09:51:51 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.55.26.1 ===
--- Zope/lib/python/webdav/Resource.py:1.55	Mon Feb  3 05:59:54 2003
+++ Zope/lib/python/webdav/Resource.py	Tue Oct 21 09:51:51 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.20.82.1 ===
--- Zope/lib/python/webdav/davcmds.py:1.20	Wed Aug 14 18:11:40 2002
+++ Zope/lib/python/webdav/davcmds.py	Tue Oct 21 09:51:51 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