gormv2升级 第一阶段
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user