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
-
Method Summary
Modifier and TypeMethodDescriptionprotected AccessDecisionManager
Deprecated.Allows subclasses to provide a customAccessDecisionManager
.protected AfterInvocationManager
Deprecated.Provide a customAfterInvocationManager
for the default implementation ofmethodSecurityInterceptor(MethodSecurityMetadataSource)
.void
Deprecated.protected AuthenticationManager
Deprecated.Allows providing a customAuthenticationManager
.protected void
Deprecated.Sub classes can override this method to register different types of authentication.protected MethodSecurityExpressionHandler
Deprecated.Provide aMethodSecurityExpressionHandler
that is registered with theExpressionBasedPreInvocationAdvice
.protected MethodSecurityMetadataSource
Deprecated.Provides a customMethodSecurityMetadataSource
that is registered with themethodSecurityMetadataSource()
.protected final MethodSecurityExpressionHandler
Deprecated.Gets theMethodSecurityExpressionHandler
or creates it usingexpressionHandler
.org.aopalliance.intercept.MethodInterceptor
methodSecurityInterceptor
(MethodSecurityMetadataSource methodSecurityMetadataSource) Deprecated.Creates the default MethodInterceptor which is a MethodSecurityInterceptor using the following methods to construct it.Deprecated.Provides the defaultMethodSecurityMetadataSource
that will be used.Deprecated.Creates thePreInvocationAuthorizationAdvice
to be used.protected RunAsManager
Deprecated.Provide a customRunAsManager
for the default implementation ofmethodSecurityInterceptor(MethodSecurityMetadataSource)
.void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) Deprecated.final void
setImportMetadata
(org.springframework.core.type.AnnotationMetadata importMetadata) Deprecated.Obtains the attributes fromEnableGlobalMethodSecurity
if this class was imported using theEnableGlobalMethodSecurity
annotation.void
Deprecated.void
setObjectPostProcessor
(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:
afterSingletonsInstantiated
in interfaceorg.springframework.beans.factory.SmartInitializingSingleton
-
afterInvocationManager
Deprecated.Provide a customAfterInvocationManager
for 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
AfterInvocationManager
to use
-
runAsManager
Deprecated.Provide a customRunAsManager
for the default implementation ofmethodSecurityInterceptor(MethodSecurityMetadataSource)
. The default is null.- Returns:
- the
RunAsManager
to use
-
accessDecisionManager
Deprecated.Allows subclasses to provide a customAccessDecisionManager
. The default is aAffirmativeBased
with the following voters:- Returns:
- the
AccessDecisionManager
to use
-
createExpressionHandler
Deprecated.Provide aMethodSecurityExpressionHandler
that is registered with theExpressionBasedPreInvocationAdvice
. The default isDefaultMethodSecurityExpressionHandler
which optionally will Autowire anAuthenticationTrustResolver
.Subclasses may override this method to provide a custom
MethodSecurityExpressionHandler
- Returns:
- the
MethodSecurityExpressionHandler
to use
-
getExpressionHandler
Deprecated.Gets theMethodSecurityExpressionHandler
or creates it usingexpressionHandler
.- Returns:
- a non
null
MethodSecurityExpressionHandler
-
customMethodSecurityMetadataSource
Deprecated.Provides a customMethodSecurityMetadataSource
that is registered with themethodSecurityMetadataSource()
. Default is null.- Returns:
- a custom
MethodSecurityMetadataSource
that 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 anAuthenticationManager
is attempted to be autowired by type.- Returns:
- the
AuthenticationManager
to 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
- theAuthenticationManagerBuilder
used to register different authentication mechanisms for the global method security.- Throws:
Exception
-
methodSecurityMetadataSource
Deprecated.Provides the defaultMethodSecurityMetadataSource
that will be used. It creates aDelegatingMethodSecurityMetadataSource
based uponcustomMethodSecurityMetadataSource()
and the attributes onEnableGlobalMethodSecurity
.- Returns:
- the
MethodSecurityMetadataSource
-
preInvocationAuthorizationAdvice
Deprecated.Creates thePreInvocationAuthorizationAdvice
to be used. The default isExpressionBasedPreInvocationAdvice
.- Returns:
- the
PreInvocationAuthorizationAdvice
-
setImportMetadata
public final void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata) Deprecated.Obtains the attributes fromEnableGlobalMethodSecurity
if this class was imported using theEnableGlobalMethodSecurity
annotation.- Specified by:
setImportMetadata
in interfaceorg.springframework.context.annotation.ImportAware
-
setObjectPostProcessor
@Autowired(required=false) public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) Deprecated. -
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:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
PrePostMethodSecurityConfiguration
,SecuredMethodSecurityConfiguration
, orJsr250MethodSecurityConfiguration
instead