Prosecuting authorities are maintaining a tough stance over the use or supply of cannabis to relieve chronic pain.
Cannabis has been downgraded to a Class C drug
Despite being downgraded to a Class C drug, possessing and supplying cannabis remained illegal, the counsel for the attorney general told the Appeal Court.
He was arguing over the case of Jeffrey Ditchfield, of Wales, who was acquitted of possessing cannabis with intent to supply as he supplied people in pain.
The court will rule if "necessity" can be used as a defence in such cases.
It is seen as a test of the law's attitude in such cases after the downgrading of cannabis.
"On any view, it simply cannot be right for this court to countenance someone who is medically unqualified supplying drugs, which have dangers attached, to other people without regulation," Counsel for Attorney General Jonathan Rees said.
He added that, as a matter of public law and order, "we don't want everyone setting up their own little home pharmacy".
He was arguing against the acquittal of Jeffrey Ditchfield, who was cleared on the basis that he had a defence of "necessity" or "duress of circumstance" when he gave cannabis to people suffering from chronic pain.
Mr Ditchfield, 43, from Rhyl, cannot be convicted of the offence, regardless of the appeal judges' decision on the legal issues raised by Lord Goldsmith in his case.
It was established law that the defence of necessity or duress was only available to those who committed an offence "in imminent peril of death or serious injury", Mr Rees told the appeal court.
Mr Ditchfield's counsel Keith Sutton said there had been "no commercial element in his trial".
"He is a donor rather than a supplier," he said.
"It was a wholly altruistic act that Mr Ditchfield had undertaken.
"He does it because he knows and comes into contact with people who are in an extremely unfortunate position."
As was made clear at his trial, Mr Ditchfield would not supply the drug without confirmation from a GP or some other medically qualified person that the recipient was suffering from acute and chronic pain.
In this way, he made sure he was not misled by "recreational users".
"Of course, if and when a cannabis-based medicine is available, Mr Ditchfield can pack up and go home," said Mr Sutton.
The judges are also considering appeals by five sufferers convicted of possessing cannabis which they had obtained to relieve serious pain.
They are Barry Quayle, 38, from Market Rasen, Lincolnshire; Reay Wales, 53, of Ipswich; Graham Kenny, 25, from Shipley, West Yorkshire, and Anthony Taylor, 54, and May Po Lee, 28, both from London.
All were given either a fine, community service or suspended jail sentence.
The court reserved judgement at the end of the hearing with no date set for its decision.