Switched to Asciidoc for README. Renamed ApplicationConfiguration to Application. Switched to a more simple package name. Some polishing in the test cases (removed unnecessary injections). Original pull request: #108.
19 lines
542 B
Plaintext
19 lines
542 B
Plaintext
= 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();
|
|
}
|
|
----
|