Browse Source
Merge pull request #483 from flipped-aurora/revert-482-gva_gormv2_dev
Revert "Gva gormv2 dev"
main
奇淼(piexlmax
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
5 deletions
-
server/service/sys_casbin.go
|
@ -91,9 +91,8 @@ func ClearCasbin(v int, p ...string) bool { |
|
|
//@return: *casbin.Enforcer
|
|
|
//@return: *casbin.Enforcer
|
|
|
|
|
|
|
|
|
var ( |
|
|
var ( |
|
|
e *casbin.Enforcer |
|
|
|
|
|
once sync.Once |
|
|
|
|
|
eLock sync.Mutex |
|
|
|
|
|
|
|
|
e *casbin.Enforcer |
|
|
|
|
|
once sync.Once |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func Casbin() *casbin.Enforcer { |
|
|
func Casbin() *casbin.Enforcer { |
|
@ -102,9 +101,7 @@ func Casbin() *casbin.Enforcer { |
|
|
e, _ = casbin.NewEnforcer(global.GVA_CONFIG.Casbin.ModelPath, a) |
|
|
e, _ = casbin.NewEnforcer(global.GVA_CONFIG.Casbin.ModelPath, a) |
|
|
e.AddFunction("ParamsMatch", ParamsMatchFunc) |
|
|
e.AddFunction("ParamsMatch", ParamsMatchFunc) |
|
|
}) |
|
|
}) |
|
|
eLock.Lock() |
|
|
|
|
|
_ = e.LoadPolicy() |
|
|
_ = e.LoadPolicy() |
|
|
eLock.Unlock() |
|
|
|
|
|
return e |
|
|
return e |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|