I was flying with a minor airline called SmartWings which didn't have online check-in, on a route between Spain and Czech Republic. At the check-in desk, my friend presented his (non-Annex II) passport without a visa (he had a residency permit) and the airline employee requested that he show his visa as well. As this was an intra-Schengen flight, I tried to argue that no visas are needed and therefore the airline shouldn't demand to see them. However as we didn't want to fight it to the bitter end, my friend surrendered and showed his EU residency card.
So who was right in this situation? Do airlines have the right to demand to see visas on intra-Schengen flights?
Links to relevant EU/Schengen laws would be appreciated to avoid speculation.