Class GlobalMethodSecurityConfiguration
java.lang.Object
org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.SmartInitializingSingleton,org.springframework.context.annotation.ImportAware
@Deprecated
@Configuration(proxyBeanMethods=false)
@Role(2)
public class GlobalMethodSecurityConfiguration
extends Object
implements org.springframework.context.annotation.ImportAware, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.beans.factory.BeanFactoryAware
Deprecated.
Base
Configuration for enabling global method security. Classes may extend this
class to customize the defaults, but must be sure to specify the
EnableGlobalMethodSecurity annotation on the subclass.- Since:
- 3.2
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AccessDecisionManagerDeprecated.Allows subclasses to provide a customAccessDecisionManager.protected AfterInvocationManagerDeprecated.Provide a customAfterInvocationManagerfor the default implementation ofmethodSecurityInterceptor(MethodSecurityMetadataSource).voidDeprecated.protected AuthenticationManagerDeprecated.Allows providing a customAuthenticationManager.protected voidDeprecated.Sub classes can override this method to register different types of authentication.protected MethodSecurityExpressionHandlerDeprecated.Provide aMethodSecurityExpressionHandlerthat is registered with theExpressionBasedPreInvocationAdvice.protected MethodSecurityMetadataSourceDeprecated.Provides a customMethodSecurityMetadataSourcethat is registered with themethodSecurityMetadataSource().protected final MethodSecurityExpressionHandlerDeprecated.Gets theMethodSecurityExpressionHandleror creates it usingexpressionHandler.org.aopalliance.intercept.MethodInterceptormethodSecurityInterceptor(MethodSecurityMetadataSource methodSecurityMetadataSource) Deprecated.Creates the default MethodInterceptor which is a MethodSecurityInterceptor using the following methods to construct it.Deprecated.Provides the defaultMethodSecurityMetadataSourcethat will be used.Deprecated.Creates thePreInvocationAuthorizationAdviceto be used.protected RunAsManagerDeprecated.Provide a customRunAsManagerfor the default implementation ofmethodSecurityInterceptor(MethodSecurityMetadataSource).voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) Deprecated.final voidsetImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata) Deprecated.Obtains the attributes fromEnableGlobalMethodSecurityif this class was imported using theEnableGlobalMethodSecurityannotation.voidDeprecated.voidsetObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) Deprecated, for removal: This API element is subject to removal in a future version.voidsetObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) Deprecated.
-
Constructor Details
-
GlobalMethodSecurityConfiguration
public GlobalMethodSecurityConfiguration()Deprecated.
-
-
Method Details
-
methodSecurityInterceptor
@Bean public org.aopalliance.intercept.MethodInterceptor methodSecurityInterceptor(MethodSecurityMetadataSource methodSecurityMetadataSource) Deprecated.Creates the default MethodInterceptor which is a MethodSecurityInterceptor using the following methods to construct it.Subclasses can override this method to provide a different
MethodInterceptor.- Parameters:
methodSecurityMetadataSource- the defaultMethodSecurityMetadataSource.- Returns:
- the
MethodInterceptor.
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()Deprecated.- Specified by:
afterSingletonsInstantiatedin interfaceorg.springframework.beans.factory.SmartInitializingSingleton
-
afterInvocationManager
Deprecated.Provide a customAfterInvocationManagerfor the default implementation ofmethodSecurityInterceptor(MethodSecurityMetadataSource). The default is null if pre post is not enabled. Otherwise, it returns aAfterInvocationProviderManager.Subclasses should override this method to provide a custom
AfterInvocationManager- Returns:
- the
AfterInvocationManagerto use
-
runAsManager
Deprecated.Provide a customRunAsManagerfor the default implementation ofmethodSecurityInterceptor(MethodSecurityMetadataSource). The default is null.- Returns:
- the
RunAsManagerto use
-
accessDecisionManager
Deprecated.Allows subclasses to provide a customAccessDecisionManager. The default is aAffirmativeBasedwith the following voters:- Returns:
- the
AccessDecisionManagerto use
-
createExpressionHandler
Deprecated.Provide aMethodSecurityExpressionHandlerthat is registered with theExpressionBasedPreInvocationAdvice. The default isDefaultMethodSecurityExpressionHandlerwhich optionally will Autowire anAuthenticationTrustResolver.Subclasses may override this method to provide a custom
MethodSecurityExpressionHandler- Returns:
- the
MethodSecurityExpressionHandlerto use
-
getExpressionHandler
Deprecated.Gets theMethodSecurityExpressionHandleror creates it usingexpressionHandler.- Returns:
- a non
nullMethodSecurityExpressionHandler
-
customMethodSecurityMetadataSource
Deprecated.Provides a customMethodSecurityMetadataSourcethat is registered with themethodSecurityMetadataSource(). Default is null.- Returns:
- a custom
MethodSecurityMetadataSourcethat is registered with themethodSecurityMetadataSource()
-
authenticationManager
Deprecated.Allows providing a customAuthenticationManager. The default is to use any authentication mechanisms registered byconfigure(AuthenticationManagerBuilder). Ifconfigure(AuthenticationManagerBuilder)was not overridden, then anAuthenticationManageris attempted to be autowired by type.- Returns:
- the
AuthenticationManagerto use - Throws:
Exception
-
configure
Deprecated.Sub classes can override this method to register different types of authentication. If not overridden,configure(AuthenticationManagerBuilder)will attempt to autowire by type.- Parameters:
auth- theAuthenticationManagerBuilderused to register different authentication mechanisms for the global method security.- Throws:
Exception
-
methodSecurityMetadataSource
Deprecated.Provides the defaultMethodSecurityMetadataSourcethat will be used. It creates aDelegatingMethodSecurityMetadataSourcebased uponcustomMethodSecurityMetadataSource()and the attributes onEnableGlobalMethodSecurity.- Returns:
- the
MethodSecurityMetadataSource
-
preInvocationAuthorizationAdvice
Deprecated.Creates thePreInvocationAuthorizationAdviceto be used. The default isExpressionBasedPreInvocationAdvice.- Returns:
- the
PreInvocationAuthorizationAdvice
-
setImportMetadata
public final void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata) Deprecated.Obtains the attributes fromEnableGlobalMethodSecurityif this class was imported using theEnableGlobalMethodSecurityannotation.- Specified by:
setImportMetadatain interfaceorg.springframework.context.annotation.ImportAware
-
setObjectPostProcessor
@Autowired(required=false) public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) Deprecated. -
setObjectPostProcessor
@Deprecated(since="6.4", forRemoval=true) @Autowired(required=false) public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) Deprecated, for removal: This API element is subject to removal in a future version. -
setMethodSecurityExpressionHandler
@Autowired(required=false) public void setMethodSecurityExpressionHandler(List<MethodSecurityExpressionHandler> handlers) Deprecated. -
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException Deprecated.- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
PrePostMethodSecurityConfiguration,SecuredMethodSecurityConfiguration, orJsr250MethodSecurityConfigurationinstead