Juvenile case information is given certain protections that adult prosecutions are not afforded, including greater protections of confidentiality. However, law enforcement officers have access to information from their own files and reports, as well as limited access to probation and court records in some cases. When and if your juvenile record is sealed, the police should be ordered to seal their own records regarding their past investigations of your alleged criminal activity. Until those records are sealed, though, officers of those investigating agencies will see that information when they run your name through their database (as well as anything which is reflected on your CII "rap sheet").
To my knowledge, there is nothing to prevent a police officer from asking about your status on probation or parole, or referencing past arrests known to that officer through personal knowledge or via dispatch/MDT. If you feel that you were treated unprofessionally, I would encourage you to make a complaint to the agency about the conduct. If you feel that your civil rights have been violated, you can look into a civil action against the officer. While not the area of law that I practice, the scenario that you put forth doesn't seem promising to me as the basis of a civil suit, but you might want to ask the question in a different forum for more a more informed response.
Any statements I make in these forums (fora?) should not be taken as direct legal advice, merely informed guidance. This is true due to the anonymous nature of this venue, and the incomplete information which is invariably provided by the questions. It is imperative that you consult directly with an attorney regarding your specific situation before acting on or relying on anything represented here. Period.
It probably matters on the situation.
On one hand, in the limited context of a traffic stop, it seems an officer certainly should be allowed to ask questions that are reasonably calculated to legitimately prevent harm to another person or stop an ongoing crime. If such questions refer to your criminal history, your having a passenger should not bar the officer from asking such questions. Otherwise, having a passenger would frustrate investigation of crimes and there could be much mischief or abuse of planting passengers to limit officer questions.
On the other hand, I can see a good argument that if you not suspected of any larger crime and the officer made a traffic stop for a minor traffic offense, his or her asking questions about a juvenile record purely to embarrass you in front of your passenger may be uncomfortable. Whether or not is a civil rights violation is best referred to a civil rights attorney, not the criminal defense attorneys to whom you posted this question.
I would recommend that you talk with a civil rights attorney.
My name is Stephen R. Cohen and have practiced since 1974. I practice in Los Angeles and Orange County, CA. These answers do not create an attorney client relationship. My answers may offend I believe in telling the truth, I use common sense as well as the law. Other state's laws may differ.. There are a lot of really good attorneys on this site, I will do limited appearances which are preparation of court documents it is , less expensive. However generally I believe an attorney is better than none.