I can't remember where it is off hand. Its one of the European Journal things that make up EU law.
I fly commercially and we get ramp checked quite a bit because the aircraft are unusual and the only thing they are interested in is pilot and aircraft documents. If you are on a non EU reg then they have every right to ask.