// AddRoleToUser associates a role with a user and tenant
// Returns an error in case of failure
AddRoleToUser associates a role with a user and tenant
Returns an error in case of failure
// AddRoleToUser associates a role with a user and tenant // Returns an error in case of failure
func (c *Client) AddRoleToUser(tenantId, userId, roleId string) error {
	url := fmt.Sprintf("%s/tenants/%s/users/%s/roles/OS-KSADM/%s", c.authUrl, tenantId, userId, roleId)
	r, err := c.do("PUT", url, nil)
	if err != nil {
		return err
	}
	if r.StatusCode > 399 {
		return errorFromResponse(r)
	}
	return nil
}
func ( c * Client ) AddRoleToUser ( tenantId , userId , roleId string ) error { url := fmt . Sprintf ( " " , c . authUrl , tenantId , userId , roleId ) r , err := c . do ( " " , url , nil ) if err != nil { return err } if r . StatusCode > 399 { return errorFromResponse ( r ) } return nil }
AddRoleToUser associates a role with a user and tenant
Returns an error in case of failure
AddRoleToUser associates a role with a user and tenant Returns an error in case of failure