I\'m using spring-data-rest and I have a MongoRepository like this:
@RepositoryRestResource
interface MyEntityRepository extends MongoRepository
This is late reply, but if you need to prevent the global http method for a entity, try it.
@Configuration
public class DataRestConfig implements RepositoryRestConfigurer {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.getExposureConfiguration()
.forDomainType(Person.class)
.withItemExposure(((metdata, httpMethods) -> httpMethods.disable(HttpMethod.PUT, HttpMethod.POST, ... )))
.withCollectionExposure((metdata, httpMethods) -> httpMethods.disable(HttpMethod.PUT, HttpMethod.POST, ...));
}
}