The answer is police officers don’t have a right to search anything. There has to be certain circumstances that will give them the reason to search your car and specifically it could happen in two ways. 1.) if there’s probable cause. For example if the police officer feels that a crime is afoot does the police officer have articulable facts to show that there is a possibility of a crime happening. Then, if so he could search your car. If he could point to probable cause. 2.) Is a safety measure if the officer is under a reasonable belief that his own safety is at jeopardy there are certain circumstances where he could search your vehicle. There is a third factor, but that factor depends on you. You can always give consent for a police officer to search your vehicle. So if a police officer simply asks you hey can I search your vehicle, even if he has no reason, even if he has no cause to ask you that question he’s allowed to ask you that question. If you say yes even if he has no probable cause even if he doesn’t feel like he’s in danger but you will allow him to search the car.