package cn.palmte.work.shiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * Created by wang.lin@esstx.cn on 2018/4/20.
 */
public class ShiroUtils {
    protected static Subject getSubject() {
        return SecurityUtils.getSubject();
    }

    public static boolean hasPermission(String permission) {
        return getSubject() != null && permission != null && permission.length() > 0 && getSubject().isPermitted(permission);
    }
}
