public abstract class AbstractSecurityExpressionHandler<T> extends java.lang.Object implements SecurityExpressionHandler<T>, org.springframework.context.ApplicationContextAware
Constructor and Description |
---|
AbstractSecurityExpressionHandler() |
Modifier and Type | Method and Description |
---|---|
org.springframework.expression.EvaluationContext |
createEvaluationContext(Authentication authentication,
T invocation)
Invokes the internal template methods to create
StandardEvaluationContext
and SecurityExpressionRoot objects. |
protected org.springframework.expression.spel.support.StandardEvaluationContext |
createEvaluationContextInternal(Authentication authentication,
T invocation)
Override to create a custom instance of
StandardEvaluationContext . |
protected abstract SecurityExpressionOperations |
createSecurityExpressionRoot(Authentication authentication,
T invocation)
Implement in order to create a root object of the correct type for the supported
invocation type.
|
org.springframework.expression.ExpressionParser |
getExpressionParser() |
protected PermissionEvaluator |
getPermissionEvaluator() |
protected RoleHierarchy |
getRoleHierarchy() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setExpressionParser(org.springframework.expression.ExpressionParser expressionParser) |
void |
setPermissionEvaluator(PermissionEvaluator permissionEvaluator) |
void |
setRoleHierarchy(RoleHierarchy roleHierarchy) |
public final org.springframework.expression.ExpressionParser getExpressionParser()
getExpressionParser
in interface SecurityExpressionHandler<T>
public final void setExpressionParser(org.springframework.expression.ExpressionParser expressionParser)
public final org.springframework.expression.EvaluationContext createEvaluationContext(Authentication authentication, T invocation)
StandardEvaluationContext
and SecurityExpressionRoot
objects.createEvaluationContext
in interface SecurityExpressionHandler<T>
authentication
- the current authentication objectinvocation
- the invocation (filter, method, channel)protected org.springframework.expression.spel.support.StandardEvaluationContext createEvaluationContextInternal(Authentication authentication, T invocation)
StandardEvaluationContext
.
The returned object will have a SecurityExpressionRootPropertyAccessor
added, allowing beans in the ApplicationContext
to be accessed via
expression properties.
authentication
- the current authentication objectinvocation
- the invocation (filter, method, channel)StandardEvaluationContext
or potentially a custom subclass if
overridden.protected abstract SecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication, T invocation)
authentication
- the current authentication objectinvocation
- the invocation (filter, method, channel)protected RoleHierarchy getRoleHierarchy()
public void setRoleHierarchy(RoleHierarchy roleHierarchy)
protected PermissionEvaluator getPermissionEvaluator()
public void setPermissionEvaluator(PermissionEvaluator permissionEvaluator)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware