I\'m creating a simple CRUD-App (a shoppinglist) with Spring Boot and Spring Data Rest. I have a resource: ShoppingItem. Is there an easy way to only return the
ShoppingItem
If you are using Spring security integration you can use ACL (maybe to heavy) or simple postFilter like following:
postFilter
public interface ShoppingItemRepository extends CrudRepository { @PostFilter("filterObject.user.getId() == principal.id") @Override Iterable findAll(); }