A golf club can install solar panels on its roof after plans were agreed with the city council.