We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first i init an enforcer by using tablePrefix
cas, _ := casbin.NewEnforcer(modelPath) adapter, err := gormadapter.NewAdapterByDBUsePrefix(db, "test_") if err != nil { panic(err) } cas.SetAdapter(adapter)
then i call func cas.LoadPolicy(), that won't found any policy cuz it search db.casbin_rule not db.test_casbin_rule
here is the code
// LoadPolicy loads policy from database. func (a *Adapter) LoadPolicy(model model.Model) error { var lines []CasbinRule // this line if err := a.db.Find(&lines).Error; err != nil { return err } for _, line := range lines { loadPolicyLine(line, model) } return nil }
The text was updated successfully, but these errors were encountered:
Please send a PR.
Sorry, something went wrong.
Would it be possible to bump the version and perform a new release?
When your PR is merged, I will bump the version and release it.
it already merge in #24
Released: https://github.com/casbin/gorm-adapter/releases/tag/v2.0.2
hsluoyz
No branches or pull requests
first i init an enforcer by using tablePrefix
then i call func cas.LoadPolicy(), that won't found any policy cuz it search db.casbin_rule
not db.test_casbin_rule
here is the code
The text was updated successfully, but these errors were encountered: