I tired to take a photo of a Coast Guard Jayhawk helicopter on the ramp at Portland International and was told to leave because the TSA doesn't allow the public to photo registration numbers on commercial, private or military aircraft. One....it says Astoria Air Station right on the side...no mystery as to it's base...two, the TSA is responsible for internal airport security while the Port police are responsible for outside security, three...on the far side of the runway as on the departure ends and approach ends of the runways there are plenty of places along the public road that you can take photos from without the hassle..four...when I showed her my Air Transport Pilot (ATP) and mentioned that I was a Captain with an (unmentioned) airline, she sheepishly agreed that she was wrong and that it was okay to photo airplanes. The problem is not of being confrontational...it is one of letting the people in "charge" know that you have rights in this country and that just because they are uneducated, stupid or just plain mean and petty, you are entitled to those rights. I will not let anybody touch my cameras, my ID or anything else for that matter if I am in a public place. If someone wants to run my plate, let them, I have nothing to hide but there are laws about reasonable suspicion and if someone sees I am in a public place taking obvious pictures of airplanes, not acting covertly or suspiciously, they don't have the right to subject me to the "9/11 defense". Just my humble opinion. Be courteous but be firm. Assert your rights, call for a supervisor.