Search in sources :

Example 6 with MethodSecurityExpressionHandler

use of org.springframework.security.access.expression.method.MethodSecurityExpressionHandler in project spring-security by spring-projects.

the class PostFilterAuthorizationMethodInterceptorTests method setExpressionHandlerWhenNotNullThenSetsExpressionHandler.

@Test
public void setExpressionHandlerWhenNotNullThenSetsExpressionHandler() {
    MethodSecurityExpressionHandler expressionHandler = new DefaultMethodSecurityExpressionHandler();
    PostFilterAuthorizationMethodInterceptor advice = new PostFilterAuthorizationMethodInterceptor();
    advice.setExpressionHandler(expressionHandler);
    assertThat(advice).extracting("expressionHandler").isEqualTo(expressionHandler);
}
Also used : DefaultMethodSecurityExpressionHandler(org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler) DefaultMethodSecurityExpressionHandler(org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler) MethodSecurityExpressionHandler(org.springframework.security.access.expression.method.MethodSecurityExpressionHandler) Test(org.junit.jupiter.api.Test)

Aggregations

MethodSecurityExpressionHandler (org.springframework.security.access.expression.method.MethodSecurityExpressionHandler)6 Test (org.junit.jupiter.api.Test)4 DefaultMethodSecurityExpressionHandler (org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler)4 Test (org.junit.Test)2 AnnotationConfigServletWebServerApplicationContext (org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext)2 PreInvocationAuthorizationAdvice (org.springframework.security.access.prepost.PreInvocationAuthorizationAdvice)2 OAuth2MethodSecurityExpressionHandler (org.springframework.security.oauth2.provider.expression.OAuth2MethodSecurityExpressionHandler)2 PermissionEvaluator (org.springframework.security.access.PermissionEvaluator)1 RoleHierarchy (org.springframework.security.access.hierarchicalroles.RoleHierarchy)1