Hey im using the golang casdoorsdk and im trying to add a role with the sdk. The code looks like this:
role := casdoorsdk.Role{
Owner: a.client.OrganizationName,
Name: location.Partner.Name + "-" + location.Name,
DisplayName: "Role for location: " + location.Name + " of partner: " + location.Partner.Name,
Description: "",
Users: []string{a.client.OrganizationName + "/" + userName},
Groups: []string{},
Roles: []string{},
Domains: []string{},
IsEnabled: true,
}
return a.client.AddRole(&role)
But i always get an bad request error, why?
I tested more now and when im assigning a string like "mystring" as name property everything works fine. But when i assigne the string from a variable into the name property it gives me a bad request error.
After some more test i found out that it only happens if you add a name with a space as string like: "my string". This is weird because in the casdoor ui and over the api i can easily add names for roles with spaces.
