
package com.tmerclub.cloud.common.security;


import com.alibaba.ttl.TransmittableThreadLocal;
import com.tmerclub.cloud.api.platform.vo.UriPermissionVO;

import java.util.List;

/**
 * @author tmerclub
 * @date 2020/7/16
 */
public class PmsContext {

    private static final ThreadLocal<List<UriPermissionVO>> PMS_HOLDER = new TransmittableThreadLocal<>();

    public static List<UriPermissionVO> get() {
        return PMS_HOLDER.get();
    }

    public static void set(List<UriPermissionVO> prems) {
        PMS_HOLDER.set(prems);
    }
    public static void clean() {
        if (PMS_HOLDER.get() != null) {
            PMS_HOLDER.remove();
        }
    }
}
