Section 7. Cities and towns may appropriate money for the purpose of acquiring and planting shade trees in public ways. The tree warden, or a private organization acting with the written consent of the tree warden, may plant shade trees acquired with public or private funds in a public way, or if he deems it expedient, upon adjoining land at a distance not exceeding 20 feet from the layout of such public way for the purpose of improving, protecting, shading or ornamenting the same; provided, however, that the written consent of the owner of such adjoining land shall first be obtained.