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