|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2019 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -174,6 +174,8 @@ public void afterSingletonsInstantiated() {
|
174 | 174 | if (grantedAuthorityDefaults != null) {
|
175 | 175 | this.defaultMethodExpressionHandler.setDefaultRolePrefix(grantedAuthorityDefaults.getRolePrefix());
|
176 | 176 | }
|
| 177 | + |
| 178 | + this.defaultMethodExpressionHandler = this.objectPostProcessor.postProcess(this.defaultMethodExpressionHandler); |
177 | 179 | }
|
178 | 180 |
|
179 | 181 | private <T> T getSingleBeanOrNull(Class<T> type) {
|
@@ -338,6 +340,7 @@ protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
338 | 340 | * @return the {@link MethodSecurityMetadataSource}
|
339 | 341 | */
|
340 | 342 | @Bean
|
| 343 | + @Role(BeanDefinition.ROLE_INFRASTRUCTURE) |
341 | 344 | public MethodSecurityMetadataSource methodSecurityMetadataSource() {
|
342 | 345 | List<MethodSecurityMetadataSource> sources = new ArrayList<>();
|
343 | 346 | ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
|
@@ -397,7 +400,6 @@ public final void setImportMetadata(AnnotationMetadata importMetadata) {
|
397 | 400 | @Autowired(required = false)
|
398 | 401 | public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
|
399 | 402 | this.objectPostProcessor = objectPostProcessor;
|
400 |
| - this.defaultMethodExpressionHandler = objectPostProcessor.postProcess(this.defaultMethodExpressionHandler); |
401 | 403 | }
|
402 | 404 |
|
403 | 405 | @Autowired(required = false)
|
|
0 commit comments