SEC-2304: rm duplicate MethodExpressionHandler from GlobalMethodSecurityConfiguration
This commit is contained in:
parent
5082a04626
commit
7537dfc33a
|
@ -282,7 +282,7 @@ public class GlobalMethodSecurityConfiguration implements ImportAware {
|
||||||
public MethodSecurityMetadataSource methodSecurityMetadataSource() {
|
public MethodSecurityMetadataSource methodSecurityMetadataSource() {
|
||||||
List<MethodSecurityMetadataSource> sources = new ArrayList<MethodSecurityMetadataSource>();
|
List<MethodSecurityMetadataSource> sources = new ArrayList<MethodSecurityMetadataSource>();
|
||||||
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
|
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
|
||||||
methodExpressionHandler());
|
getExpressionHandler());
|
||||||
MethodSecurityMetadataSource customMethodSecurityMetadataSource = customMethodSecurityMetadataSource();
|
MethodSecurityMetadataSource customMethodSecurityMetadataSource = customMethodSecurityMetadataSource();
|
||||||
if (customMethodSecurityMetadataSource != null) {
|
if (customMethodSecurityMetadataSource != null) {
|
||||||
sources.add(customMethodSecurityMetadataSource);
|
sources.add(customMethodSecurityMetadataSource);
|
||||||
|
@ -300,16 +300,6 @@ public class GlobalMethodSecurityConfiguration implements ImportAware {
|
||||||
return new DelegatingMethodSecurityMetadataSource(sources);
|
return new DelegatingMethodSecurityMetadataSource(sources);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the {@link MethodSecurityExpressionHandler} to be used.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public MethodSecurityExpressionHandler methodExpressionHandler() {
|
|
||||||
return new DefaultMethodSecurityExpressionHandler();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the {@link PreInvocationAuthorizationAdvice} to be used. The
|
* Creates the {@link PreInvocationAuthorizationAdvice} to be used. The
|
||||||
* default is {@link ExpressionBasedPreInvocationAdvice}.
|
* default is {@link ExpressionBasedPreInvocationAdvice}.
|
||||||
|
@ -319,7 +309,7 @@ public class GlobalMethodSecurityConfiguration implements ImportAware {
|
||||||
@Bean
|
@Bean
|
||||||
public PreInvocationAuthorizationAdvice preInvocationAuthorizationAdvice() {
|
public PreInvocationAuthorizationAdvice preInvocationAuthorizationAdvice() {
|
||||||
ExpressionBasedPreInvocationAdvice preInvocationAdvice = new ExpressionBasedPreInvocationAdvice();
|
ExpressionBasedPreInvocationAdvice preInvocationAdvice = new ExpressionBasedPreInvocationAdvice();
|
||||||
preInvocationAdvice.setExpressionHandler(methodExpressionHandler());
|
preInvocationAdvice.setExpressionHandler(getExpressionHandler());
|
||||||
return preInvocationAdvice;
|
return preInvocationAdvice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue