Closed zhtiyissr closed 1 year ago
https://github.com/casbin/gorm-adapter/blob/master/adapter.go
func loadPolicyLine(line CasbinRule, model model.Model) error { var p = []string{line.Ptype, line.V0, line.V1, line.V2, line.V3, line.V4, line.V5} index := len(p) - 1 for p[index] == "" { index-- } index += 1 p = p[:index] err := persist.LoadPolicyArray(p, model) if err != nil { return nil } return err }
Finally, the processing of error, when the error is not nil, it should return the error itself, otherwise return empty
@tangyang9464 @JalinWang @imp2002
@bbqe1314 this commit: https://github.com/casbin/gorm-adapter/commit/5ffa22b86f0c3c4617929350393bb1137d8f3ddc introduced this bug, can you make a PR to fix it?
https://github.com/casbin/gorm-adapter/blob/master/adapter.go
Finally, the processing of error, when the error is not nil, it should return the error itself, otherwise return empty