Class MessageAuthorizationContextSecurityExpressionHandler
java.lang.Object
org.springframework.security.messaging.access.expression.MessageAuthorizationContextSecurityExpressionHandler
- All Implemented Interfaces:
org.springframework.aop.framework.AopInfrastructureBean
,SecurityExpressionHandler<MessageAuthorizationContext<?>>
public final class MessageAuthorizationContextSecurityExpressionHandler
extends Object
implements SecurityExpressionHandler<MessageAuthorizationContext<?>>
An expression handler for
MessageAuthorizationContext
.- Since:
- 5.8
-
Constructor Summary
ConstructorDescriptionMessageAuthorizationContextSecurityExpressionHandler
(SecurityExpressionHandler<org.springframework.messaging.Message<?>> expressionHandler) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.expression.EvaluationContext
createEvaluationContext
(Supplier<Authentication> authentication, MessageAuthorizationContext<?> message) Provides an evaluation context in which to evaluate security expressions for the invocation type.org.springframework.expression.EvaluationContext
createEvaluationContext
(Authentication authentication, MessageAuthorizationContext<?> message) Provides an evaluation context in which to evaluate security expressions for the invocation type.org.springframework.expression.ExpressionParser
-
Constructor Details
-
MessageAuthorizationContextSecurityExpressionHandler
public MessageAuthorizationContextSecurityExpressionHandler() -
MessageAuthorizationContextSecurityExpressionHandler
public MessageAuthorizationContextSecurityExpressionHandler(SecurityExpressionHandler<org.springframework.messaging.Message<?>> expressionHandler)
-
-
Method Details
-
getExpressionParser
public org.springframework.expression.ExpressionParser getExpressionParser()- Specified by:
getExpressionParser
in interfaceSecurityExpressionHandler<MessageAuthorizationContext<?>>
- Returns:
- an expression parser for the expressions used by the implementation.
-
createEvaluationContext
public org.springframework.expression.EvaluationContext createEvaluationContext(Authentication authentication, MessageAuthorizationContext<?> message) Description copied from interface:SecurityExpressionHandler
Provides an evaluation context in which to evaluate security expressions for the invocation type.- Specified by:
createEvaluationContext
in interfaceSecurityExpressionHandler<MessageAuthorizationContext<?>>
-
createEvaluationContext
public org.springframework.expression.EvaluationContext createEvaluationContext(Supplier<Authentication> authentication, MessageAuthorizationContext<?> message) Description copied from interface:SecurityExpressionHandler
Provides an evaluation context in which to evaluate security expressions for the invocation type. You can override this method in order to provide a custom implementation that uses lazy initialization of theAuthentication
object. By default, this method uses eager initialization of theAuthentication
object.- Specified by:
createEvaluationContext
in interfaceSecurityExpressionHandler<MessageAuthorizationContext<?>>
- Parameters:
authentication
- theSupplier
of theAuthentication
to usemessage
- theSecurityExpressionHandler
to use- Returns:
- the
EvaluationContext
to use
-