The Spanish authorities do have the scope to make life difficult for the Rock's inhabitants, and Spanish Foreign Minister García-Margallo has commented that this time, "the party is over". Madrid has already introduced stringent border checks on people travelling in and out of the territory - resulting in up to seven hour queues on the border (in stifling heat) - and further actions have been threatened, including €50 levy on cars entering and leaving the territory, as well as a tax crackdown on Gibraltarians who live on the Spanish side of the border.
Leaving aside the question of whether this is even in Spain's own interest given its own economic problems (thousands of Spanish citizens work in Gibraltar), are these types of measures - particularly the levy - even permitted under EU free movement rules? EU law prohibits discrimination against citizens of other member states when it comes to free movement, and the UK has indicated it could issue a legal challenge.
So does the UK have a good case? Article 45 of the EU Treaties which establish the principle of free movement states that:
2. Such freedom of movement shall entail the abolition of any discrimination based on nationality between workers of the Member States as regards employment, remuneration and other conditions of work and employment.
3. It shall entail the right, subject to limitations justified on grounds of public policy, public security or public health:Discrimination is clearly prohibited for the purposes of employment, as is the ability to "move freely" within member states for this purpose, although exemptions for "public policy" and "public security" are quite vague. However, the right to free movement covers the right to live and work in another member state, it does not address the more specific issue of travelling between two member states for this purpose.
(a) to accept offers of employment actually made;
(b) to move freely within the territory of Member States for this purpose;
The UK and/or the Gibralterian authorities could however argue that the burdensome checks are a de facto impediment to the ability of British and Spanish citizens to exercise their right to work in another member state (i.e. on the other side of the border) and are therefore illegal under EU law. This is particularly true as the restrictions would not apply to the other border crossings, such as the Portuguese or French ones, although the Spanish could counter that the levy would be no different to localised toll roads or charges.
On the border crossing issue, EU member states are still allowed to police their own external borders, but internal border controls have been abolished in the Schengen area of which the UK is not a part. Therefore, Spanish authorities have the right to impose border controls, but according to a Commission source they have to be "proportional".
In other words, we have absolutely no idea whether the UK would be successful should it take Spain to the ECJ. The wonders of EU law...