public abstract class AbstractSecurityExpressionHandler<T> extends Object implements SecurityExpressionHandler<T>, ApplicationContextAware
Constructor and Description |
---|
AbstractSecurityExpressionHandler() |
Modifier and Type | Method and Description |
---|---|
EvaluationContext |
createEvaluationContext(Authentication authentication,
T invocation)
Invokes the internal template methods to create
StandardEvaluationContext
and SecurityExpressionRoot objects. |
protected 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.
|
ExpressionParser |
getExpressionParser() |
protected PermissionEvaluator |
getPermissionEvaluator() |
protected RoleHierarchy |
getRoleHierarchy() |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setExpressionParser(ExpressionParser expressionParser) |
void |
setPermissionEvaluator(PermissionEvaluator permissionEvaluator) |
void |
setRoleHierarchy(RoleHierarchy roleHierarchy) |
public final ExpressionParser getExpressionParser()
getExpressionParser
in interface SecurityExpressionHandler<T>
public final void setExpressionParser(ExpressionParser expressionParser)
public final 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 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(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware