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

Fix varibale name in casbin docs #78

Merged
merged 2 commits into from
Jul 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions website/content/middleware/casbin-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ description = "Casbin Auth middleware for Echo. It supports access control model
- RESTful
- Deny-override: both allow and deny authorizations are supported, deny overrides the allow.

> Echo community contribution
> Echo community contribution

## Dependencies

```go
import (
"github.com/casbin/casbin"
casbin_mw "github.com/labstack/echo-contrib/casbin"
casbin_mw "github.com/labstack/echo-contrib/casbin"
)
```

*Usage*

```go
e := echo.New()
e.Use(casbin-mw.Middleware(casbin.NewEnforcer("casbin_auth_model.conf", "casbin_auth_policy.csv")))
e.Use(casbin_mw.Middleware(casbin.NewEnforcer("casbin_auth_model.conf", "casbin_auth_policy.csv")))
```

For syntax, see: [Model.md](https://github.com/casbin/casbin/blob/master/Model.md).
Expand All @@ -49,7 +49,7 @@ e := echo.New()
ce := casbin.NewEnforcer("casbin_auth_model.conf", "")
ce.AddRoleForUser("alice", "admin")
ce.AddPolicy(...)
e.Use(casbin_mw.MiddlewareWithConfig(casbin-mw.Config(
e.Use(casbin_mw.MiddlewareWithConfig(casbin_mw.Config(
Enforcer: ce,
)))
```
Expand Down