The Green Party say it will legalise cannabis if it forms a government next year.