golang rbac框架
在 https://github.com/mikespook/gorbac/tree/v1.0 github上新的版本是开发板,得用这里的老版 demo package main import ( "gopkg.in/mikespook/gorbac.v1" "fmt" ) func main() { permissions := []string{"admin","guest","normal"} rbac := gorbac.New() rbac.Add("rico",permissions[1:],[]string{}) IsGranted := rbac.IsGranted("rico","guest",nil) fmt.Println("grant is ", IsGranted)...阅读全文