package com.sinata.shop.core.shiro.check;
|
|
import com.sinata.core.util.SpringContextHolder;
|
|
/**
|
* 权限检查管理器(入口)
|
*/
|
public class PermissionCheckManager {
|
private final static PermissionCheckManager me = new PermissionCheckManager();
|
|
private com.sinata.shop.core.shiro.check.ICheck defaultCheckFactory = SpringContextHolder.getBean(com.sinata.shop.core.shiro.check.ICheck.class);
|
|
public static PermissionCheckManager me() {
|
return me;
|
}
|
|
private PermissionCheckManager() {
|
}
|
|
public PermissionCheckManager(com.sinata.shop.core.shiro.check.ICheck checkFactory) {
|
this.defaultCheckFactory = checkFactory;
|
}
|
|
public void setDefaultCheckFactory(ICheck defaultCheckFactory) {
|
this.defaultCheckFactory = defaultCheckFactory;
|
}
|
|
public static boolean check(Object[] permissions) {
|
return me.defaultCheckFactory.check(permissions);
|
}
|
|
public static boolean checkAll() {
|
return me.defaultCheckFactory.checkAll();
|
}
|
}
|