gormv2升级 第一阶段

This commit is contained in:
QM303176530
2020-08-23 15:13:23 +08:00
parent f130aec168
commit 363ff3ba70
40 changed files with 133 additions and 99 deletions

View File

@@ -21,7 +21,8 @@ func CasbinHandler() gin.HandlerFunc {
sub := waitUse.AuthorityId
e := service.Casbin()
// 判断策略中是否存在
if global.GVA_CONFIG.System.Env == "develop" || e.Enforce(sub, obj, act) {
success, _ := e.Enforce(sub, obj, act)
if global.GVA_CONFIG.System.Env == "develop" || success {
c.Next()
} else {
response.Result(response.ERROR, gin.H{}, "权限不足", c)