package com.lantone.security.component;

import com.lantone.security.facade.base.ResourceFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @Description: 资源与角色访问对应关系操作组件
 * @author: rengb
 * @time: 2021/1/5 18:27
 */
@Component
public class ResourceRoleRulesHolder implements CommandLineRunner {

    @Autowired
    private ResourceFacade resourceFacade;

    /**
     * 预加载所有资源与角色访问对应关系
     */
    @Override
    public void run(String... args) throws Exception {
        resourceFacade.initResourceRolesMap();
    }

}