use of org.springframework.integration.security.channel.ChannelSecurityMetadataSource in project spring-integration by spring-projects.
the class ChannelSecurityInterceptorBeanPostProcessor method postProcessBeforeInitialization.
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
if (this.accessPolicyMapping != null && bean instanceof ChannelSecurityInterceptor && this.accessPolicyMapping.containsKey(beanName)) {
Map<Pattern, ChannelAccessPolicy> accessPolicies = this.accessPolicyMapping.get(beanName);
ChannelSecurityMetadataSource securityMetadataSource = (ChannelSecurityMetadataSource) ((ChannelSecurityInterceptor) bean).obtainSecurityMetadataSource();
for (Map.Entry<Pattern, ChannelAccessPolicy> entry : accessPolicies.entrySet()) {
securityMetadataSource.addPatternMapping(entry.getKey(), entry.getValue());
}
}
return bean;
}
Aggregations