/** * This allows SpEL support in Spring Data JPA @Query definitions. * <p> * See https://spring.io/blog/2014/07/15/spel-support-in-spring-data-jpa-query-definitions */ @Bean EvaluationContextExtension securityExtension() { return new EvaluationContextExtensionSupport() { @Override public String getExtensionId() { return "security"; } @Override public SecurityExpressionRoot getRootObject() { return new SecurityExpressionRoot(SecurityContextHolder.getContext().getAuthentication()) { }; } }; }
/** * This allows SpEL support in Spring Data JPA @Query definitions. * * See https://spring.io/blog/2014/07/15/spel-support-in-spring-data-jpa-query-definitions */ @Bean EvaluationContextExtension securityExtension() { return new EvaluationContextExtensionSupport() { @Override public String getExtensionId() { return "security"; } @Override public SecurityExpressionRoot getRootObject() { return new SecurityExpressionRoot(SecurityContextHolder.getContext().getAuthentication()) {}; } }; }
@Bean public EvaluationContextExtension securityExtension() { return new SecurityEvaluationContextExtension(); }
@Bean EvaluationContextExtension securityExtension() { return new SecurityEvaluationContextExtension(); }
/** * Extend SpEL with security concerns * @return */ @Bean public EvaluationContextExtension securityExtension() { return new SecurityEvaluationContextExtension(); }