Question: lock depth and resource
johaven opened this issue · 3 comments
wsgidav/wsgidav/lock_man/lock_manager.py
Line 385 in c3f3019
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:
wsgidav/tests/test_scripted.py
Line 538 in e190939
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!