package com.liquidnet.service.chime.config;

import com.liquidnet.common.web.config.WebMvcConfig;
import com.liquidnet.common.web.filter.GlobalAuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

@Configuration
public class ChimeWebMvcConfig extends WebMvcConfig {
    @Autowired
    @Lazy
    public GlobalAuthorityInterceptor globalAuthorityInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(this.globalAuthorityInterceptor).addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}
