We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 40f995b + 86cfebb commit 8ad644aCopy full SHA for 8ad644a
server/service/sys_casbin.go
@@ -91,9 +91,8 @@ func ClearCasbin(v int, p ...string) bool {
91
//@return: *casbin.Enforcer
92
93
var (
94
- e *casbin.Enforcer
95
- once sync.Once
96
- eLock sync.Mutex
+ e *casbin.Enforcer
+ once sync.Once
97
)
98
99
func Casbin() *casbin.Enforcer {
@@ -102,9 +101,7 @@ func Casbin() *casbin.Enforcer {
102
101
e, _ = casbin.NewEnforcer(global.GVA_CONFIG.Casbin.ModelPath, a)
103
e.AddFunction("ParamsMatch", ParamsMatchFunc)
104
})
105
- eLock.Lock()
106
_ = e.LoadPolicy()
107
- eLock.Unlock()
108
return e
109
}
110
0 commit comments