e, err := casbin.NewEnforcer("model.conf", "policy.csv")
if err != nil {
log.Print(err.Error())
}
e.AddFunction("mydemo", KeyMatchFunc)
r := e.GetRoleManager()
r.(*defaultrolemanager.RoleManager).AddDomainMatchingFunc("mydemo", MyKeyMatch)
pers, _ := e.GetImplicitPermissionsForUser("alice", "domain2")
current without those func , if we want change default rbac function we should pass one and then call loadPolicy if we forget
call loadPolicy , jcasbin will not working as golang version
just like golang version
current without those func , if we want change default rbac function we should pass one and then call loadPolicy if we forget call loadPolicy , jcasbin will not working as golang version