Files
spring-data-examples/mongodb/security
Oliver Gierke 4164bc4607 #297 - Upgraded to Boot 2.0 and Spring Data Kay.
Bumped version number to 2.0. Upgraded to Spring Boot 2.0.

Stuff disabled in the meantime:

- Cassandra: needs API adaptions in configuration
- JPA > Security: test fails with weird Hibernate error
- Redis > Reactive: API updates needed
- Solr: configration updates necessary

adjust versions

Updated elastic search to the new version.

Fixed the reactor version to Bismuth-BUILD-SNAPSHOT. This probably should be undone when boot references the proper bom.
2017-10-06 15:15:53 +02:00
..
2015-07-16 08:24:43 +02:00

= Spring Data MongoDB - Spring Security integration.

This project contains samples of the Spring Security integration in Spring Data (MongoDB).

== Support for SpEL expression based filtering

[source, java]
----
public interface PersonRepository extends CrudRepository<Person, String> {

  @Override
  List<Person> findAll();

  // Custom query method with filtering based on Spring Security context information
  @Query("{id: ?#{ hasRole('ROLE_ADMIN') ? {$exists:true} : principal.id}}")
  List<Person> findAllForCurrentUserById();
}
----