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
package main
import (
"fmt""github.com/casbin/casbin"
)
funcmain(){
e:=casbin.NewEnforcer("rbac_with_domains_model.conf")
e.EnableLog(true)
user:="alice"sub:="admin"// the user that wants to access a resource.dom:="domain1"list:=e.GetRolesForUserInDomain(user,dom)
fmt.Println(list)
ife.AddRoleForUserInDomain(user,sub,dom){
list:=e.GetRolesForUserInDomain(user,dom)
fmt.Println(list)
}
}
Found through the tracking code, e.model["g"]["g"].RM is nil。
I am solving this problem now, but I don't know if it is a bug.
package main
import (
"fmt""github.com/casbin/casbin"
)
funcmain(){
e:=casbin.NewEnforcer("rbac_with_domains_model.conf")
e.EnableLog(true)
user:="alice"sub:="admin"// the user that wants to access a resource.dom:="domain1"ife.GetModel()["g"]["g"].RM!=nil {
list:=e.GetRolesForUserInDomain(user,dom)
fmt.Println(list)
}
ife.AddRoleForUserInDomain(user,sub,dom){
list:=e.GetRolesForUserInDomain(user,dom)
fmt.Println(list)
}
}
The text was updated successfully, but these errors were encountered:
code show as below
Found through the tracking code,
e.model["g"]["g"].RM
is nil。I am solving this problem now, but I don't know if it is a bug.
The text was updated successfully, but these errors were encountered: