fix: need to load policies

This commit is contained in:
Derrick Hammer 2024-01-15 22:53:51 -05:00
parent 87ebf5012b
commit f0b92aa2d6
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,11 @@ func GetCasbin(logger *zap.Logger) *casbin.Enforcer {
_ = a.AddPolicy("admin", "/admin", []string{"POST"}) _ = a.AddPolicy("admin", "/admin", []string{"POST"})
_ = a.AddPolicy("admin", "/admin", []string{"DELETE"}) _ = a.AddPolicy("admin", "/admin", []string{"DELETE"})
err = e.LoadPolicy()
if err != nil {
logger.Fatal("Failed to load policies into Casbin model", zap.Error(err))
}
return e return e
} }