Skip to content

Commit

Permalink
Fix varibale name in casbin docs (#78)
Browse files Browse the repository at this point in the history
* fix variable name in casbin docs

* remove trailing whitespace
  • Loading branch information
ekeih authored and vishr committed Jul 30, 2018
1 parent 205dfce commit 09e9f94
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 09e9f94

Please sign in to comment.