Is it possible to completely disallow PUT for a repository in Spring Data REST while POST on the collection and PATCH on the item remain possible?
The rationale behind this is that a PUT typically allows for replace semantics, but in our case the resource can only be created via POST on the collection, partially updated via PATCH on the item (using specific UI dialogs... each of which only supports a particular partial update), or deleted via DELETE on the item.
If you have Spring security in your application, then this can be done by adding intercept-url to deny access to PUT method on Spring data repository, something like below:
<security:intercept-url pattern="/{repositoryPath}" method="PUT" access="denyAll" />
来源:https://stackoverflow.com/questions/24766067/how-to-disallow-put-while-allowing-post-and-patch-in-spring-data-rest