Skip to content
New issue

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

[Bug] example code in docs is wrong #270

Closed
Frederic-Zhou opened this issue Aug 23, 2021 · 4 comments · Fixed by #269
Closed

[Bug] example code in docs is wrong #270

Frederic-Zhou opened this issue Aug 23, 2021 · 4 comments · Fixed by #269
Assignees
Labels
bug Something isn't working

Comments

@Frederic-Zhou
Copy link

In: https://casbin.org/docs/en/model-storage#load-model-from-string

// Load the policy rules from the .CSV file adapter.
// Replace it with your adapter to avoid files.
a := fileadapter.NewAdapter("examples/rbac_policy.csv")

// Create the enforcer.
e := casbin.NewEnforcer(m, a)

This is wrong:

a := model.NewModelFromString("examples/rbac_policy.csv")

and:

e := casbin.NewEnforcer(m, a)

@casbin-bot
Copy link
Member

@closetool @tangyang9464

@hsluoyz
Copy link
Member

hsluoyz commented Aug 23, 2021

@Frederic-Zhou plz change title and text to English, thanks!

@tangyang9464
Copy link
Member

tangyang9464 commented Aug 26, 2021

fixed. See casbin-website#269

@hsluoyz hsluoyz changed the title [Bug]官方文档中似乎有错误 [Bug] bug in docs Aug 27, 2021
@hsluoyz hsluoyz changed the title [Bug] bug in docs [Bug] example code in docs is wrong Aug 27, 2021
@hsluoyz hsluoyz transferred this issue from casbin/casbin Aug 27, 2021
@casbin-bot
Copy link
Member

@ErikQQY

@casbin-bot casbin-bot added the bug Something isn't working label Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants