mar10/wsgidav

Question: lock depth and resource

johaven opened this issue · 3 comments

if u != url and lock["depth"] != "infinity":

In the reference above and more generally, there is something that bothers me.

Let's say I want to create a lock of depth 0 (or infinite) on a collection /foo/bar

If a parent lock with infinite depth exists on resource /foo/doc.txt, then we cannot create the lock on resource /foo/bar.

Overall, shouldn't we only allow infinite depth on collections and 0 depth on resources?
Or it would be necessary to determine whether the parent locks are files or folders for this to make more sense.

I checked the RFC and found no guidance on this.

The lock_manager only knows about urls and has no concept of collections/non-collections.
However in this test I could lock a collection and a non-collection that live under the same parent:

def testLocking_issue320(self):

I expected you to examine the parents' children but that is not the case in this case, I must have been a little tired when I thought I detected this. Sorry for the mistake :)

No problem, thanks for contributing anyway!