auth := Authorizer{} auth.Authorize(req) // req is the incoming http request
auth.policy = func(req *http.Request) bool { userRole := getUserRole(req) if userRole == "admin" { return true } return false }
auth.errMsg = "You do not have permission to access this resource"Package Library: The package library for github.com.juju.juju.apiserver.common Authorizer is "github.com/juju/juju/apiserver/common".