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
ConstructorsConstructorDescriptionMessageAuthorizationContextSecurityExpressionHandler(SecurityExpressionHandler<org.springframework.messaging.Message<?>> expressionHandler) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.expression.EvaluationContextcreateEvaluationContext(Supplier<Authentication> authentication, MessageAuthorizationContext<?> message) Provides an evaluation context in which to evaluate security expressions for the invocation type.org.springframework.expression.EvaluationContextcreateEvaluationContext(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:
getExpressionParserin 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:SecurityExpressionHandlerProvides an evaluation context in which to evaluate security expressions for the invocation type.- Specified by:
createEvaluationContextin interfaceSecurityExpressionHandler<MessageAuthorizationContext<?>>
-
createEvaluationContext
public org.springframework.expression.EvaluationContext createEvaluationContext(Supplier<Authentication> authentication, MessageAuthorizationContext<?> message) Description copied from interface:SecurityExpressionHandlerProvides 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 theAuthenticationobject. By default, this method uses eager initialization of theAuthenticationobject.- Specified by:
createEvaluationContextin interfaceSecurityExpressionHandler<MessageAuthorizationContext<?>>- Parameters:
authentication- theSupplierof theAuthenticationto usemessage- theSecurityExpressionHandlerto use- Returns:
- the
EvaluationContextto use
-