Package org.springframework.security.authorization.method

# Class PreFilterAuthorizationMethodInterceptor

java.lang.Object
org.springframework.security.authorization.method.PreFilterAuthorizationMethodInterceptor

All Implemented Interfaces:
  `org.aopalliance.aop.Advice`, `org.aopalliance.intercept.Interceptor`, `org.aopalliance.intercept.MethodInterceptor`, `org.springframework.aop.Advisor`, `org.springframework.aop.framework.AopInfrastructureBean`, `org.springframework.aop.PointcutAdvisor`, `org.springframework.core.Ordered`, `AuthorizationAdvisor`

public final class PreFilterAuthorizationMethodInterceptor extends Object implements AuthorizationAdvisor
A `MethodInterceptor` which filters a method argument by evaluating an expression from the `PreFilter` annotation.

Since:
  5.6

## Field Summary

### Fields inherited from interface org.springframework.aop.Advisor

`EMPTY_ADVICE`

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`PreFilterAuthorizationMethodInterceptor()`
Creates a `PreFilterAuthorizationMethodInterceptor` using the provided parameters

## Method Summary

Modifier and Type
Method
Description
`org.aopalliance.aop.Advice`
`getAdvice()`
`int`
`getOrder()`
`org.springframework.aop.Pointcut`
`getPointcut()`
`Object`
`invoke(org.aopalliance.intercept.MethodInvocation mi)`
Filter the method argument specified in the `PreFilter` annotation that `MethodInvocation` specifies.
`boolean`
`isPerInstance()`
`void`
`setExpressionHandler(MethodSecurityExpressionHandler expressionHandler)`
Use this `MethodSecurityExpressionHandler`
`void`
`setOrder(int order)`
`void`
`setSecurityContextHolderStrategy(SecurityContextHolderStrategy strategy)`
Sets the `SecurityContextHolderStrategy` to use.
`void`
`setTemplateDefaults(PrePostTemplateDefaults defaults)`
Deprecated.
Please use `setTemplateDefaults(AnnotationTemplateExpressionDefaults)` instead
`void`
`setTemplateDefaults(AnnotationTemplateExpressionDefaults defaults)`
Configure pre/post-authorization template resolution

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PreFilterAuthorizationMethodInterceptor

public PreFilterAuthorizationMethodInterceptor()
Creates a `PreFilterAuthorizationMethodInterceptor` using the provided parameters

## Method Details

### setExpressionHandler

public void setExpressionHandler(MethodSecurityExpressionHandler expressionHandler)
Use this `MethodSecurityExpressionHandler`

Parameters:
  `expressionHandler` - the `MethodSecurityExpressionHandler` to use

### setTemplateDefaults

@Deprecated public void setTemplateDefaults(PrePostTemplateDefaults defaults)
Deprecated.
Please use `setTemplateDefaults(AnnotationTemplateExpressionDefaults)` instead
Configure pre/post-authorization template resolution

By default, this value is `null`, which indicates that templates should not be resolved.

Parameters:
  `defaults` - - whether to resolve pre/post-authorization templates parameters
Since:
  6.3

### setTemplateDefaults

public void setTemplateDefaults(AnnotationTemplateExpressionDefaults defaults)
Configure pre/post-authorization template resolution

By default, this value is `null`, which indicates that templates should not be resolved.

Parameters:
  `defaults` - - whether to resolve pre/post-authorization templates parameters
Since:
  6.4

### getOrder

public int getOrder()

Specified by:
  `getOrder` in interface `org.springframework.core.Ordered`

### setOrder

public void setOrder(int order)

### getPointcut

public org.springframework.aop.Pointcut getPointcut()

Specified by:
  `getPointcut` in interface `org.springframework.aop.PointcutAdvisor`

### getAdvice

public org.aopalliance.aop.Advice getAdvice()

Specified by:
  `getAdvice` in interface `org.springframework.aop.Advisor`

### isPerInstance

public boolean isPerInstance()

Specified by:
  `isPerInstance` in interface `org.springframework.aop.Advisor`

### setSecurityContextHolderStrategy

public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy strategy)
Sets the `SecurityContextHolderStrategy` to use. The default action is to use the `SecurityContextHolderStrategy` stored in `SecurityContextHolder`.

Since:
  5.8

### invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation mi) throws Throwable
Filter the method argument specified in the `PreFilter` annotation that `MethodInvocation` specifies.

Specified by:
  `invoke` in interface `org.aopalliance.intercept.MethodInterceptor`
Parameters:
  `mi` - the `MethodInvocation` to check
Throws:
  `Throwable`