Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

buffalo-mw-rbac

Installation

$ go get -u github.com/kgosse/buffalo-mw-rbac

Usage

// setup casbin auth rules.
authEnforcer, err := casbin.NewEnforcer("rbac_model.conf", "rbac_policy.csv")
if err != nil {
  log.Fatal(err)
}

// Create role func.
roleFunc := func(c buffalo.Context) (string, error) {
  // implement your logic to get user's role
  role := "anonymous"
  return role, nil
}
app.Use(rbac.New(authEnforcer, roleFunc))

About

buffalo casbin-based rbac middleware

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages