The Regulation of Investigatory Power (Scotland) Act, introduced in 2000 by Tony Blair's Labour government, gave security services, the police and HMRC permission to carry out surveillance techniques, such as wire-tapping and the bugging of houses and vehicles.

The introduction of the act was controversial - while the intention was said to be tackling terrorism, internet crime and paedophilia, critics raised concerns it would infringe on privacy rights.

Within less than a decade, the number of organisations allowed to use RIPSA had soared: when the legislation was originally passed, only nine organisations were allowed to use it. By 2008, that figure had reached almost 1000.

Recently the legislation has been in the spotlight over claims that it is being exploited and misused, with local police even invoking it in cases of petty crime.

In 2008, five councils in Wales were revealed to have spied on their staff under RIPSA. One of those under surveillance was Kim Shaw, a teacher who was on sick leave and under suspicion of feigning illness.

Caerphilly council had a surveillance company follow Shaw, noting the way she walked, what she said and even the expressions on her face.

Shaw - who was innocent - later described the experience as "really threatening and almost violating".

The Investigatory Powers Tribunal was established in 2000 alongside RIPSA to hear complaints about surveillance by public bodies, but most are rejected. Between 2000 and 2009, 956 complaints were made to the tribunal. However, only four were upheld.