public class SecurityEvaluationContextExtension
extends org.springframework.data.repository.query.spi.EvaluationContextExtensionSupport
By defining this object as a Bean, Spring Security is exposed as SpEL expressions for creating Spring Data queries.
With Java based configuration, we can define the bean using the following:
For example, if you return a UserDetails that extends the following User object:
| Constructor and Description |
|---|
SecurityEvaluationContextExtension()
Creates a new instance that uses the current
Authentication found on the
SecurityContextHolder. |
SecurityEvaluationContextExtension(Authentication authentication)
Creates a new instance that always uses the same
Authentication object. |
| Modifier and Type | Method and Description |
|---|---|
String |
getExtensionId() |
Object |
getRootObject() |
public SecurityEvaluationContextExtension()
Authentication found on the
SecurityContextHolder.public SecurityEvaluationContextExtension(Authentication authentication)
Authentication object.authentication - the Authentication to usepublic String getExtensionId()
public Object getRootObject()
getRootObject in interface org.springframework.data.repository.query.spi.EvaluationContextExtensiongetRootObject in class org.springframework.data.repository.query.spi.EvaluationContextExtensionSupport