|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration
@Configuration public class GlobalMethodSecurityConfiguration
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.
EnableGlobalMethodSecurity
Constructor Summary | |
---|---|
GlobalMethodSecurityConfiguration()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GlobalMethodSecurityConfiguration()
Method Detail |
---|
@Bean public org.aopalliance.intercept.MethodInterceptor methodSecurityInterceptor() throws Exception
accessDecisionManager()
afterInvocationManager()
authenticationManager()
methodSecurityMetadataSource()
runAsManager()
Subclasses can override this method to provide a different MethodInterceptor
.
Exception
protected AfterInvocationManager afterInvocationManager()
AfterInvocationManager
for the default
implementation of methodSecurityInterceptor()
. The default is
null if pre post is not enabled. Otherwise, it returns a AfterInvocationProviderManager
.
Subclasses should override this method to provide a custom AfterInvocationManager
protected RunAsManager runAsManager()
RunAsManager
for the default implementation of
methodSecurityInterceptor()
. The default is null.
protected AccessDecisionManager accessDecisionManager()
AccessDecisionManager
. The default is a AffirmativeBased
with the following voters:
protected MethodSecurityExpressionHandler expressionHandler()
MethodSecurityExpressionHandler
that is
registered with the ExpressionBasedPreInvocationAdvice
. The default is
DefaultMethodSecurityExpressionHandler
Subclasses may override this method to provide a custom MethodSecurityExpressionHandler
protected final MethodSecurityExpressionHandler getExpressionHandler()
MethodSecurityExpressionHandler
or creates it using expressionHandler
.
null
MethodSecurityExpressionHandler
protected MethodSecurityMetadataSource customMethodSecurityMetadataSource()
MethodSecurityMetadataSource
that is registered
with the methodSecurityMetadataSource()
. Default is null.
MethodSecurityMetadataSource
that is registered
with the methodSecurityMetadataSource()
protected AuthenticationManager authenticationManager() throws Exception
AuthenticationManager
. The default is
to use any authentication mechanisms registered by registerAuthentication(AuthenticationManagerBuilder)
. If
registerAuthentication(AuthenticationManagerBuilder)
was not overriden, then an AuthenticationManager
is attempted to be autowired by type.
Exception
protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception
registerAuthentication(AuthenticationManagerBuilder)
will attempt to autowire by type.
auth
- the AuthenticationManagerBuilder
used to register different authentication mechanisms for the
global method security.
Exception
@Bean public MethodSecurityMetadataSource methodSecurityMetadataSource()
MethodSecurityMetadataSource
that will be
used. It creates a DelegatingMethodSecurityMetadataSource
based
upon customMethodSecurityMetadataSource()
and the attributes on
EnableGlobalMethodSecurity
.
@Bean public MethodSecurityExpressionHandler methodExpressionHandler()
MethodSecurityExpressionHandler
to be used.
@Bean public PreInvocationAuthorizationAdvice preInvocationAuthorizationAdvice()
PreInvocationAuthorizationAdvice
to be used. The
default is ExpressionBasedPreInvocationAdvice
.
@Role(value=2) @Bean public MethodSecurityMetadataSourceAdvisor metaDataSourceAdvisor()
MethodSecurityMetadataSourceAdvisor
to be used.
public final void setImportMetadata(AnnotationMetadata importMetadata)
EnableGlobalMethodSecurity
if this class was imported using the EnableGlobalMethodSecurity
annotation.
setImportMetadata
in interface ImportAware
@Autowired public void setApplicationContext(ApplicationContext context)
@Autowired(required=false) public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |