You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func main() {
// Initialize a Beego ORM adapter and use it in a Casbin enforcer:
a := beegoormadapter.NewAdapter( "mysql", "root:xxxx@tcp(127.0.0.1:3306)/casbin",true) // Your driver and data source.
e, err := casbin.NewEnforcer("model.conf", a)
if err != nil {
log.Fatalln(err)
}
// Check the permission.
e.Enforce("alice", "data1", "read")
// Modify the policy.
// e.AddPolicy(...)
// e.RemovePolicy(...)
// Save the policy back to DB.
e.SavePolicy()
}
What's your scenario? What do you want to achieve?
Your model:
Your policy:
test code
Frame error:
The text was updated successfully, but these errors were encountered: