I'm using Spring-Data-Rest and I want to secure the GET-Request of an entity only if one does not request a projection (since the projections hide all the sensible stuff). e.g.:
public interface UsergroupRepository extends OwnableRepository<User> {
@PostAuthorize("@userService.isMe(returnObject)")
Optional<Usergroup> findById(Long id);
}
But this rule forbids the access to the projections, too. So what can I do?