package cn.quantgroup.xyqb.security;

import org.springframework.security.core.Authentication;

/**
 * Created by Administrator on 2021/7/3 0003.
 */
public final class AuthorityManager {
    private static final ThreadLocal<Authentication> authenticationThreadLocal = new ThreadLocal<>();

    static final void authentication(Authentication authentication){
        authenticationThreadLocal.set(authentication);
    }

    public static final Authentication authentication(){
        return authenticationThreadLocal.get();
    }

    static final void release(){
        authenticationThreadLocal.remove();
    }

}
