-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add API parameters to specify the lock type
Signed-off-by: Julius Härtl <[email protected]> tmp: bump max version Signed-off-by: Julius Härtl <[email protected]>
- Loading branch information
1 parent
2c3e8d7
commit 9357689
Showing
6 changed files
with
45 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,8 @@ Locks are separated into three different types: | |
This lock type is initiated by a user manually through the WebUI or Clients and will limit editing capabilities on the file to the lock owning user. | ||
- **1 App owned lock:** | ||
This lock type is created by collaborative apps like Text or Office to avoid outside changes through WevDAV or other apps. | ||
- **2 Token owned lock:** (not implemented yet) This lock type will bind the ownership to the provided lock token. Any request that aims to modify the file will be required to sent the token, the user itself is not able to write to files without the token. This will allow to limit the locking to an individual client. | ||
- **2 Token owned lock:** This lock type will bind the ownership to the provided lock token. Any request that aims to modify the file will be required to sent the token, the user itself is not able to write to files without the token. This will allow to limit the locking to an individual client. | ||
- This is mostly used for automatic client locking, e.g. when a file is opened in a client or with WebDAV clients that support native WebDAV locking. The lock token can be skipped on follow up requests using the OCS API or the `X-User-Lock` header for WebDAV requests, but in that case the server will not be able to validate the lock ownership when unlocking the file from the client. | ||
|
||
### Capability | ||
|
||
|
@@ -88,6 +89,11 @@ curl -X LOCK \ | |
--header 'X-User-Lock: 1' | ||
``` | ||
|
||
#### Headers | ||
|
||
- `X-User-Lock`: Indicate that locking shall ignore token requirements that the WebDAV standard required. | ||
- `X-User-Lock-Type`: The type of the lock (see description above) | ||
|
||
#### Response | ||
|
||
The response will give back the updated properties after obtaining the lock with a `200 Success` status code or the existing lock details in case of a `423 Locked` status. | ||
|
@@ -123,6 +129,11 @@ curl -X UNLOCK \ | |
--header 'X-User-Lock: 1' | ||
``` | ||
|
||
#### Headers | ||
|
||
- `X-User-Lock`: Indicate that locking shall ignore token requirements that the WebDAV standard required. | ||
- `X-User-Lock-Type`: The type of the lock (see description above) | ||
|
||
#### Response | ||
|
||
```xml | ||
|
@@ -155,6 +166,13 @@ curl -X UNLOCK \ | |
curl -X PUT 'http://admin:[email protected]/ocs/v2.php/apps/files_lock/lock/123' -H 'OCS-APIREQUEST: true'` | ||
``` | ||
|
||
#### Parameters | ||
|
||
- `lockType` (optional): The type of the lock. Defaults to `0` (user owned manual lock). Possible values are: | ||
- `0`: User owned manual lock | ||
- `1`: App owned lock | ||
- `2`: Token owned lock | ||
|
||
#### Success | ||
``` | ||
<?xml version="1.0"?> | ||
|
@@ -193,6 +211,13 @@ curl -X PUT 'http://admin:[email protected]/ocs/v2.php/apps/files_lock/lock/ | |
curl -X DELETE 'http://admin:[email protected]/ocs/v2.php/apps/files_lock/lock/123' -H 'OCS-APIREQUEST: true' | ||
``` | ||
|
||
#### Parameters | ||
|
||
- `lockType` (optional): The type of the lock. Defaults to `0` (user owned manual lock). Possible values are: | ||
- `0`: User owned manual lock | ||
- `1`: App owned lock | ||
- `2`: Token owned lock | ||
|
||
#### Success | ||
``` | ||
<?xml version="1.0"?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters