Iris web framework's casbin middleware.
The authorization determines a request based on {subject, object, action}
. Please refer to the Casbin's documentation in order to understand how it works first.
$ go get github.com/casbin/casbin/v2@latest
$ go get github.com/iris-contrib/middleware/casbin@master
- UseRouter, recommended as it provides the full casbin's functionalities
- Use, register to a specific routes or parties
Each example has its own model, configuration and its tests, please read them as well.