This repository contains a number of Go applications, each demonstrates a different approach to implementing Resource-Based Authorization (RBAC) for a simple HTTP API.
To run an example, cd
to its directory and run go run .
.
For example, to run the casbin
example:
$ cd casbin
$ go run .
Staring server on 0.0.0.0:8080
You can now send requests using curl
. For example:
$ curl -X POST -f -u [email protected]:x http://localhost:8080/api/megaSeeds
curl: (22) The requested URL returned error: 403
$ curl -X GET -f -u [email protected]:x http://localhost:8080/api/megaSeeds
"Got permission"⏎