Skip to content

Commit

Permalink
[9.x.x] - Remove deprecated @unlock, @refresh-lock endpoints (#1235)
Browse files Browse the repository at this point in the history
* Remove deprecated @unlock, @refresh-lock endpoints

* CHANGELOG entry

* Remove warnings from locking docs

* #1235 is a breaking change

* Add information about locking to upgrade guide

---------

Co-authored-by: Timo Stollenwerk <stollenwerk@kitconcept.com>
Co-authored-by: Timo Stollenwerk <tisto@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 25, 2023
1 parent eac02a7 commit a132711
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 98 deletions.
13 changes: 0 additions & 13 deletions docs/source/endpoints/locking.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The API consumer can create, read, update, and delete a content-type lock.
| `PATCH` | `/@lock` | Refresh existing lock |
| `DELETE` | `/@lock` | Unlock an object |


## Locking an object

To lock an object, send a `POST` request to the `/@lock` endpoint that is available on any content object in Plone:
Expand Down Expand Up @@ -59,7 +58,6 @@ The server responds with status {term}`200 OK` and returns the lock information:
:language: http
```


## Unlocking an object

To unlock an object, send a `DELETE` request to the `/@lock` endpoint:
Expand Down Expand Up @@ -88,11 +86,6 @@ The server responds with status {term}`200 OK` and returns the lock information:
:language: http
```

```{warning}
The `@unlock` endpoint is deprecated and will be removed in `plone.restapi` 9.0.
```


## Refreshing a lock

An existing lock can be refreshed by sending a `PATCH` request to the `@lock` endpoint:
Expand All @@ -108,11 +101,6 @@ The server responds with status {term}`200 OK` and returns the lock information
:language: http
```

```{warning}
The `@refresh-lock` endpoint is deprecated and will be removed in `plone.restapi` 9.0.
```


## Getting lock information

To find out if an object is locked or to get information about the current lock, you can send a `GET` request to the `@lock` endpoint:
Expand All @@ -128,7 +116,6 @@ The server responds with status {term}`200 OK` and returns the information about
:language: http
```


## Updating a locked object

To update a locked object with a `PATCH` request, you have to provide the lock token with the `Lock-Token` header:
Expand Down
13 changes: 13 additions & 0 deletions docs/source/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ In `plone.restapi` 9.0.0, the following response would be returned with a `breac

Pull Request: https://github.com/plone/plone.restapi/pull/1636

### Remove deprecated @unlock, @refresh-lock endpoints

The deprecated @unlock and @refresh-unlock endpoints were removed in `plone.restapi` 9.

Send a DELETE request to the @lock endpoint to release a lock (replaces the @unlock endpoint).

Send a PATCH request to the @lock endpoint to refresh a lock (replaces the @refresh-unlock endpoint).

See the documentation of the `@lock`endpoint for more information: https://plonerestapi.readthedocs.io/en/latest/endpoints/locking.html

Pull Request: https://github.com/plone/plone.restapi/pull/1235


### Remove plone.tiles and the @tiles endpoint

`plone.restapi` 9 removed the @tiles endpoint and removed the dependency to plone.tiles. The @tiles endpoint was deprecated since `plone.restapi` 8.
Expand Down
1 change: 1 addition & 0 deletions news/1235.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove deprecated @unlock, @refresh-lock endpoints [@avoinea]
17 changes: 0 additions & 17 deletions src/plone/restapi/services/locking/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,4 @@
name="@lock"
/>

<!-- DEPRECATED -->
<plone:service
method="POST"
factory=".locking.Unlock"
for="Products.CMFCore.interfaces.IContentish"
permission="cmf.ModifyPortalContent"
name="@unlock"
/>

<plone:service
method="POST"
factory=".locking.RefreshLock"
for="Products.CMFCore.interfaces.IContentish"
permission="cmf.ModifyPortalContent"
name="@refresh-lock"
/>

</configure>
68 changes: 0 additions & 68 deletions src/plone/restapi/services/locking/locking.py

This file was deleted.

0 comments on commit a132711

Please sign in to comment.