Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Locking: proof-of-concept of the resource unlock API

  • Loading branch information...
commit b5f240eabfd71fb548465d87244f15d855942963 1 parent 5284d1f
@vjt vjt authored
Showing with 5 additions and 2 deletions.
  1. +2 −0  README.md
  2. +3 −2 lib/rack_dav/controller.rb
View
2  README.md
@@ -88,6 +88,8 @@ to retrieve and change the resources:
* __lock(token, timeout, scope, type, owner)__: Lock this resource.
If scope, type and owner are nil, refresh the given lock.
+* __unlock(token)__: Unlock this resource
+
Note, that it is generally possible, that a resource object is
instantiated for a not yet existing resource.
View
5 lib/rack_dav/controller.rb
@@ -202,9 +202,10 @@ def lock
def unlock
raise MethodNotAllowed unless resource.respond_to?(:unlock)
- raise NoContent
- end
+ locktoken = request_locktoken('LOCK_TOKEN')
+ response.status = resource.unlock(locktoken) ? NoContent : Forbidden
+ end
private
Please sign in to comment.
Something went wrong with that request. Please try again.