#107 - Polishing.
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.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.people;
|
||||
package example.people;
|
||||
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -28,12 +28,8 @@ import org.springframework.security.data.repository.query.SecurityEvaluationCont
|
||||
* @author Thomas Darimont
|
||||
*/
|
||||
@SpringBootApplication
|
||||
class ApplicationConfiguration {
|
||||
class Application {
|
||||
|
||||
public @Bean LoggingEventListener mongoEventListener() {
|
||||
return new LoggingEventListener();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public EvaluationContextExtension securityExtension() {
|
||||
return new SecurityEvaluationContextExtension();
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.people;
|
||||
package example.people;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -21,7 +21,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
/**
|
||||
* An entity to represent a Person.
|
||||
* An entity to represent a {@link Person}.
|
||||
*
|
||||
* @author Thomas Darimont
|
||||
*/
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.people;
|
||||
package example.people;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,9 +25,7 @@ import org.springframework.data.repository.CrudRepository;
|
||||
*
|
||||
* @author Thomas Darimont
|
||||
*/
|
||||
public interface PersonRepository extends CrudRepository<Person, String> {
|
||||
|
||||
List<Person> findAll();
|
||||
interface PersonRepository extends CrudRepository<Person, String> {
|
||||
|
||||
@Query("{id: ?#{ hasRole('ROLE_ADMIN') ? {$exists:true} : principal.id}}")
|
||||
List<Person> findAllForCurrentUserById();
|
||||
Reference in New Issue
Block a user