Answer: it would depend on the situation.
Step-by-step explanation:
Unfortunately I don’t have enough info on this alone to make a good call but I can give you this...
The police officer doesn’t have the right to improper searches. That being said the officer may ask for consent to look in the car, but if he is not given permission than he cannot without reason. There are some exceptions however. Police dogs for instance are very good at smelling, and although this problem doesn’t specifically say our officer used a dog, a dog could very well have smelled the drugs. If the dog alerted the officer, then he has a right to search the car. Ultimately I can’t be sure but this is what I will say. The officer was in the wrong. What the man had in his car was plenty illegal (in most states, assuming he went to court would say it was illegal in this one) but regardless he shouldn’t have had his stuff browsed by the officer. The court case would most likely favor the man as he would probably win saying the officer didn’t ask for consent. He still would most likely end up in prison for possession of illegal narcotics and the officer could face a punishment like being fired. Hope it helps.