Class AuthorizationManagerBeforeReactiveMethodInterceptor
java.lang.Object
org.springframework.security.authorization.method.AuthorizationManagerBeforeReactiveMethodInterceptor
- 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 AuthorizationManagerBeforeReactiveMethodInterceptor
extends Object
implements AuthorizationAdvisor
A
MethodInterceptor
which can determine if an Authentication
has access
to the MethodInvocation
using the configured
ReactiveAuthorizationManager
.- Since:
- 5.8
-
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
ConstructorDescriptionAuthorizationManagerBeforeReactiveMethodInterceptor
(org.springframework.aop.Pointcut pointcut, ReactiveAuthorizationManager<org.aopalliance.intercept.MethodInvocation> authorizationManager) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.aopalliance.aop.Advice
int
getOrder()
org.springframework.aop.Pointcut
invoke
(org.aopalliance.intercept.MethodInvocation mi) Determines if anAuthentication
has access to theMethodInvocation
using the configuredReactiveAuthorizationManager
.boolean
Creates an instance for thePreAuthorize
annotation.preAuthorize
(ReactiveAuthorizationManager<org.aopalliance.intercept.MethodInvocation> authorizationManager) Creates an instance for thePreAuthorize
annotation.void
setOrder
(int order)
-
Constructor Details
-
AuthorizationManagerBeforeReactiveMethodInterceptor
public AuthorizationManagerBeforeReactiveMethodInterceptor(org.springframework.aop.Pointcut pointcut, ReactiveAuthorizationManager<org.aopalliance.intercept.MethodInvocation> authorizationManager) Creates an instance.- Parameters:
pointcut
- thePointcut
to useauthorizationManager
- theReactiveAuthorizationManager
to use
-
-
Method Details
-
preAuthorize
Creates an instance for thePreAuthorize
annotation.- Returns:
- the
AuthorizationManagerBeforeReactiveMethodInterceptor
to use
-
preAuthorize
public static AuthorizationManagerBeforeReactiveMethodInterceptor preAuthorize(ReactiveAuthorizationManager<org.aopalliance.intercept.MethodInvocation> authorizationManager) Creates an instance for thePreAuthorize
annotation.- Parameters:
authorizationManager
- theReactiveAuthorizationManager
to use- Returns:
- the
AuthorizationManagerBeforeReactiveMethodInterceptor
to use
-
invoke
Determines if anAuthentication
has access to theMethodInvocation
using the configuredReactiveAuthorizationManager
.- Specified by:
invoke
in interfaceorg.aopalliance.intercept.MethodInterceptor
- Parameters:
mi
- theMethodInvocation
to use- Returns:
- the
Publisher
from theMethodInvocation
or aPublisher
error if access is denied - Throws:
Throwable
-
getPointcut
public org.springframework.aop.Pointcut getPointcut()- Specified by:
getPointcut
in interfaceorg.springframework.aop.PointcutAdvisor
-
getAdvice
public org.aopalliance.aop.Advice getAdvice()- Specified by:
getAdvice
in interfaceorg.springframework.aop.Advisor
-
isPerInstance
public boolean isPerInstance()- Specified by:
isPerInstance
in interfaceorg.springframework.aop.Advisor
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-