Class EnforceUtils

java.lang.Object
com.sankcrm.erp.casbin.EnforceUtils

@Component("casbinEnforceUtils") public class EnforceUtils extends Object
CasbinEnforcer工厂.
Since:
2.1.1
Author:
zhsxin
create time:
2023/4/24 下午6:31
  • Constructor Details

  • Method Details

    • get

      public static org.casbin.jcasbin.main.Enforcer get(com.sankcrm.erp.auth.domain.model.casbin.CasbinModelId modelId)
      获取权限校验器
      Parameters:
      modelId - 模型编号
      Returns:
      校验器
    • enforce

      public static boolean enforce(com.sankcrm.erp.auth.domain.model.casbin.CasbinModelId modelId, Object... items)
      校验权限
      Parameters:
      modelId - 权限模型
      items - 校验对象
      Returns:
      true 可以访问, 反之不能访问