OUTER HOUSE, COURT OF SESSION
 CSOH 168
OPINION OF LORD GLENNIE
In the Petition of
for Judicial Review of a failure by the Aberdeen City Council and others to provide him with a reasonable opportunity of rehabilitation
Petitioner: Leighton; Drummond Miller LLP
First Respondents: Irvine; Morton Fraser LLP
The Second Respondents and First Interested Party were not represented
11 December 2015
 The petitioner is serving a sentence of life imprisonment. The punishment part of his sentence, set (after an appeal) at nine years, expired in March 2005. He is presently detained at the Open Estate at Castle Huntly, Longforgan. He complains that he has not been given a reasonable opportunity to progress through the prison estate and demonstrate his safety for release.
 In R (Haney) v Secretary of State for Justice  1 AC 1344 at para 36, the Supreme Court accepted as implicit in the scheme of article 5 ECHR that the state is under a duty to provide a reasonable opportunity for a prisoner serving a life long term indefinite sentence, including a life sentence, to rehabilitate himself and to demonstrate that he no longer presents an unacceptable danger to the public.
 The second respondents to this petition are the Scottish Ministers. It is averred in the petition that they were in breach of their Haney duty in a number of respects. They have lodged answers accepting that they were under such a duty that denying but they were in breach of it. That issue is not presently before me for decision.
 The petitioner also complains about the alleged failings of Aberdeen City Council. They are the first respondents. It is averred that they have an important role to play in the rehabilitation process. And it is averred that, in so far as they do have such a role, they too owe a Haney duty to the petitioner, i.e. a duty to provide him with a reasonable opportunity to rehabilitate himself and to demonstrate that he no longer presents an unacceptable danger. That is disputed by the council. They deny that they are or were under any such duty.
 By agreement of all parties, including Police Scotland as first interested party, the hearing before me was restricted to the issue of whether, in light of the decision of the Supreme Court in Haney, the first respondent owed any relevant duty to the petitioner under article 5 ECHR and, if so, the scope of such duty. Neither the second respondents nor the first interested party were represented at the hearing. The absence of the second respondents was in some ways regrettable, since the role played by the local authority often overlaps, and in some cases is coordinated with, that played by the Scottish Ministers through the Scottish Prison Service (“SPS”). It might have been useful to hear from the Scottish Ministers in response to the detailed arguments presented at the hearing, and to gain some insight from them as to the practicalities and the day to day arrangements between them and the local authority. Any analysis of the duties, if any, owed by the local authority might have had some impact on an assessment of the duties owed by the Scottish Ministers. In the result, however, I have come to the view that the issues discussed before me concerning the duties owed by the local authority can be decided without the necessity of hearing argument from Scottish Ministers.
The petitioner’s averments in the petition
 The progress of a life sentence prisoner through the prison estate generally depends upon him making progress in various ways and demonstrating an ability to behave appropriately, with a view to his eventual assessment by the Parole Board in terms of section 2(5) of the Prisoners and Criminal Proceedings (Scotland) Act 1993. The Parole Board will direct his release on licence only if satisfied that it is no longer necessary for the protection of the public that he should still be confined. At a late stage in this process, before assessment by the Parole Board, a life sentence prisoner will usually progress to National Top End (“NTE”) and from there to the Open Estate. Part of the purpose of the Open Estate is to test prisoners in conditions of greater freedom. In general the Parole Board will only consider prisoners for release on licence if they have spent a not insubstantial amount of time in the Open Estate.
 In the present case the petitioner has been transferred to the Open Estate on a number of occasions without conspicuous success. In December 2009 he was transferred to the Open Estate but was downgraded to closed conditions in May 2010. He required to undertake a Healthy Sexual Functioning course in November 2011. In August 2012 he was again transferred to the Open Estate but was again downgraded to closed conditions in October 2013. He spent some 20 months in closed conditions at HMP Edinburgh before being transferred back to the Open Estate in Castle Huntly, where he now is, in June 2015.
 The petitioner makes a number of averments concerning the role played by the first respondents in this process and their alleged failings.
(1) In statement 14 he says that his release from the Open Estate into the community in the past was on a very restricted basis, thereby depriving him of the opportunity to demonstrate that any risk he posed had been reduced. The first respondents, along with staff from SACRO operating under their direction, subjected him to almost constant supervision, determining his movements and subjecting him to such stringent conditions that he was not effectively tested. On one occasion he was left alone outwith prison for a total of only 30 minutes. He avers that other prisoners in the Open Estate are subject to less restrictive regimes. He avers that the restrictions imposed on him were unnecessary and disproportionate to the risk he poses.
(2) In statement 15 the petitioner avers that in order to demonstrate that he is safe to release he requires to have access to a “home leave” address to which he can be released temporarily. However, on the last occasion he was in the Open Estate the first respondents did not identify a home leave address for him, with the result that he was not given the opportunity to demonstrate that the risk posed by him had reduced. He admits (in statement 14) that the first respondents have prepared numerous Home Leave Reports and Home Background Reports assessing a number of addresses as suitable for home or special escorted leave by the petitioner, but complains (in statement 15) that the Home Background Report prepared in respect of his brother’s home did not assess it as suitable for home leaves and that the accommodation assessed in the other reports was never made available for his use. He says that he has been informed by different members of staff that there is not an address in Aberdeen that is suitable for home leaves by him.
(3) In statement 18, referring to the period after his recent return to the Open Estate at Castle Huntly, he avers that on 3 August 2015, at a meeting with representatives from the first and second respondents, he was told about the licence conditions that were likely to be imposed on him and the likely timeframe for advancement and progression in the Open Estate. It was indicated that the likely conditions of any temporary release would include the following: not to deviate from any specified route when travelling to or from any location; to inform staff of any relationship, whether platonic or intimate, with an individual of either sex; not to enter any shop; not to have any contact directly or indirectly with any female; to comply with all directions of agencies such as social work, police, SACRO and SPS; to make any phone used by him available at all times to all agencies; and to complete activity sheets for any activity that he might wish to undertake. He would have to request permission from staff to undertake any activity outwith prison and would have first to identify the risk factors associated with that activity, failing which permission would be refused. He would be required to keep with him at all times a mobile phone provided to him, and that he had to use that phone to confirm his position at each individual stage of any journey. For example, for a journey to the Social Work Department in Aberdeen, he would have to telephone from Dundee railway station upon departure, from Aberdeen railway station upon arrival there, from Aberdeen Social Work Office upon arrival there, from Aberdeen Social Work Office when departing from there, from Aberdeen railway station upon departing from their and from Dundee railway station upon his arrival there. The petitioner says that these conditions are so strict that they are likely to engender ill-will and frustration in him; he will inevitably fail to comply with them completely, with the result that he will be downgraded from the Open Estate. They are so restrictive that they frustrate the purpose of testing him in conditions of greater freedom.
It is, of course, important to stress at this stage that these are the averments made by the petitioner. There has been no proof of those averments.
 Against this background, the petitioner seeks to focus his averments of fault on the first and second respondents. He avers in para 19 that he does not know the detailed mechanisms for determining the conditions for temporary release from the Open Estate into the community and identifying and, if necessary, providing him with a “home leave” address. There appears to be some interaction between the first and second respondents to determine what those conditions are. He calls on the first and second respondents to aver and vouch what that mechanism is. He is aware that the first respondents have “through care responsibilities” for the petitioner, albeit that the second respondents have overall responsibility for his management. He says that the first respondents have social work staff who operate in the prison and also staff who are involved with the supervision and monitoring of prisoners when they are released on licence. The second respondents, by contrast, do not have any such staff. He avers that the MAPPA group, established under the Multi-Agency Public Protection Arrangements, may have some responsibility by way of oversight or advice. The MAPPA group are, or include, the respondents and Police Scotland.
 After making averments about the alleged failures of the second respondents to provide him timeously with a reasonable opportunity to rehabilitate himself, the petitioner goes on in statement 23 to make these averments relevant to his case against the first respondents. It is necessary to set them out in full.
“23 That the failure to provide the petitioner with adequate opportunities to be tested in the community was and is a breach of the petitioner’s rights in terms of article 5 of the ECHR. The respondents are obliged to provide the petitioner with an opportunity that is reasonable in all the circumstances to reform himself and to demonstrate to the Parole Board that he no longer presented or presents an unacceptable risk to the public. The petitioner was not, is not being and, it appears, will not be afforded a reasonable opportunity to reform himself and to demonstrate to the Parole Board at the point of the expiry of his tariff that he was no longer present (sic) and unacceptable risk to the public. The failure to provide a reasonable opportunity for rehabilitation was, is and will be a breach of article 5. The failure meant that the petitioner was detained for public protection for a time without having had a reasonable opportunity to demonstrate that he was not a danger to the public. The petitioner’s return to the Open Estate was unreasonably delayed. The proposed conditions of licence are unduly restrictive. Reference is made to [Haney]. All public bodies, including the first respondents, are obliged to comply with the Human Rights Act. Although the first respondents are not responsible for the petitioner’s imprisonment or his release they are responsible for providing him with opportunities to prove himself as safe to the Parole Board. In particular, the petitioner understands that they are responsible for vetting any proposed home leave address and providing him with a home leave address if he does not have an otherwise suitable address. They have through-care responsibilities for the petitioner. On the previous occasion that the petitioner was in the Open Estate, he was not able to provide a suitable home leave address. In those circumstances it was incumbent upon the first respondents to provide one, which they did not do. The first respondents, in part, determined the petitioner’s movements when he was released on temporary licence in the past. The first respondents, along with staff from SACRO, subjected the petitioner to almost constant supervision on the previous occasion he was in the Open Estate, when he was outwith prison. At that time, the first respondents subjected the petitioner to intense scrutiny and supervision with the result that he was not suitably “tested out”. The preparation for release of prisoners on life licence takes place under a “through-care” function, provided by local authorities in co-operation with the SPS. Local authorities have statutory functions in the supervision and care of those released from prison under s27 of the Social Work (Scotland) Act 1968. Sections 12 and 12A of the 1968 Act place duties upon local authorities to assess the needs of prisoners released on licence and to provide advice, guidance and assistance to them. The National Outcomes and Standards for Social Work Services in the Criminal Justice System, published August 2010, state that criminal justice social work services contribute to effective throughcare in partnership with the SPS and other agencies (at 2.3, page 14). They also indicate that preparation for release from prison is an element of rehabilitation undertaken by the first respondents, in partnership with the SPS (at page 24). Local authorities also have an obligation to provide housing to people who would otherwise be homeless or who are threatened with homelessness – reference is made to the Housing (Scotland) Act 1987, Part II. These different responsibilities should be interpreted to create an obligation upon the first respondents to provide reasonable rehabilitative opportunities as in the Haney duty. The first and second respondents have co-extensive duties to provide reasonable opportunities for rehabilitation but given the respective roles of the local authority and central government what can reasonably be expected of them is different. The first respondents have staff that are involved with the supervision and monitoring of the petitioner and other prisoners when they are released on licence. The first respondents have social work staff. The first respondents have staff who could provide advice, guidance and assistance to prisoners when they are outwith prison. The second respondents do not have social work staff. The second respondents do not have staff outwith prison who are responsible for the supervision or monitoring of prisoners or who could assist them. In order for the Haney duty to be effective it should be interpreted to apply to the first respondents as they are involved in a real and practical sense with the petitioner’s rehabilitation and supervision outwith prison. The second respondents are not. The second respondents are responsible for the management of the petitioner’s sentence and have overall responsibility for the penal system. Esto the Haney duty is not enforceable against the first respondents in respect of supervision and other necessary rehabilitative incidents outwith prison it has to be enforceable against the second respondents in order that the rights afforded to the petitioner under article 5 are practical and effective to any extent. …”
Arguments for the petitioner and the first respondents
 Both parties submitted full Notes of Argument in advance of the hearing for which I am grateful.
 For the petitioner, Mr Leighton emphasised two matters in particular. The first was that the duty in Haney related not simply to the provision of opportunities for rehabilitation, which was largely the responsibility of the Scottish Ministers, but also to the provision of opportunities for the prisoner to demonstrate that he no longer presented an unacceptable risk to the public. That involved the active co-operation of the local authority. The second was that the duty expressed in Haney was a duty on the “state”. That included all public bodies such as the local authority. The local authority were in any event required in terms of section 6 of the Human Rights Act 1998 to act in accordance with Convention rights. Against that background Mr Leighton drew my attention, by reference to certain documents lodged in process, to the role played by the first respondents. They have no overall responsibility for the petitioner’s imprisonment. That is for the Scottish Ministers, through the SPS. Nor are they responsible for taking decisions about the petitioner’s ultimate release. That is for the Parole Board. But they do undertake tasks which are important in relation to his efforts to rehabilitate himself and, in particular, to demonstrate that he no longer presents an unacceptable risk. To demonstrate that the petitioner needs to be given the opportunity of being tested in the community, particularly in home leave; and the provision of home background reports and, where necessary, of a suitable home leave address, which is the responsibility of the local authority, is an essential step in this process.
 In support of his submissions Mr Leighton referred to the duties imposed on local authorities by sections 12, 12A and 27 of the Social Work (Scotland) Act 1968 towards people in need and, in particular, as he submitted, prisoners released on licence. He pointed out that in terms of the Housing (Scotland) Act 1987 local authorities have obligations to provide housing to people who would otherwise be homeless or who are threatened with homelessness, including people who are intentionally homeless. This might include prisoners eligible for release on licence. He also referred to throughcare responsibilities resting on the local authority under reference to a document entitled “National Objectives for Social Work Services in the Criminal Justice System: Standards – Throughcare” published in 2004, and a document entitled “National Outcomes and Standards for Social Work Services in the Criminal Justice System”, published by the Scottish Government in August 2010. The former states in Chapter 1 that the standards referred to therein relate to the “prison-based components of throughcare services supplied to the Scottish Prison Service by local authority social work departments and to the community based components of throughcare services provided by local authority social work departments in collaboration with other agencies” and explains that the term “throughcare” is used “to denote the provision of a range of social work and associated services to prisoners and their families from the point of sentence or remand, during the period of imprisonment and following release into the community”, adding that the services are primarily concerned, amongst other things, to assist prisoners to prepare for release. The latter states that criminal justice social work services contribute to effective throughcare in partnership with the SPS and other agencies, and (at page 24) that preparation for release from prison is an element of rehabilitation undertaken by the local authority in partnership with the SPS. Finally, Mr Leighton referred to the ICM [i.e. Integrated Case Management] Practice Guidance Manual 2007, issued by the Scottish Executive (as it was then), which, at para 5.2, provided guidance in relation to the role of community based social work and stated that the overall aims and objectives throughout the period of custody and after release included “the rehabilitation and re-settlement of the offender”. This material, he submitted, showed clearly that the local authority played an important role in the rehabilitation of prisoners prior to and with a view to their release.
 Mr Leighton submitted that there was no reason to restrict the Haney duty to central government. The fact that in the United Kingdom matters were organised so that some of the functions of rehabilitation were within the sphere of central government whereas others were within that of local authorities should not mean that part of those functions, i.e. those within the sphere of local authorities, were immune from the Haney duty. The petitioner’s case was that either the first respondents owed a general duty to the petitioner and other prisoners such as that identified in Haney; or the various statutory duties imposed upon them in terms of the other enactments referred to should be interpreted in such a way as to place an obligation upon the first respondents equivalent to that imposed by Haney upon the Scottish Ministers. He emphasised that the duties imposed upon the first and second respondents in areas where their functions overlapped or depended upon each other were co-extensive.
 Ms Irwin, for the first respondent, denied that the local authority owed the petitioner any relevant duties under article 5 ECHR whether read in light of Haney or otherwise. Article 5 was concerned with the right to liberty and security of person. The basic tenet of article 5(1) was that no one should be deprived of his liberty save in certain exception. The only relevant exception here was that set out in article 5(1)(a), namely the lawful detention of a person after conviction by a competent court. In James, Wells & Lee v United Kingdom (2014) 56 EHRR 399 the Strasbourg court had held that part of the purpose of an indeterminate sentence was rehabilitation. The Supreme Court in Haney had accepted that. In identifying the duty on the state to provide a reasonable opportunity for a prisoner to rehabilitate himself and to demonstrate that he no longer presents an unacceptable danger to the public, the court had emphasised that this was not a duty owed under either article 5(1)(a), the exception of lawful detention, or article 5(4), concerned with rights of access to court (viz the Parole Board) to secure release, but was closely analogous to it, arising at an earlier stage than the duty imposed by article 5(4): see para 38. The important point was that the Haney duty is not a freestanding duty applicable to the state in all circumstances but arises out of the role of the state in depriving a person of his liberty and seeking to justify having done so on the basis, under article 5(1)(a), that that person was lawfully detained after conviction by a competent court. That is why the duty is imposed on the state. It is the state that detains a person pursuant to a sentence of imprisonment imposed by a court. That duty, imposed on the state in those particular circumstances, is not transferable to a local authority which has no power to detain a person and has no role in deciding whether he should be detained.
 In support of her submissions Ms Irwin emphasised that prosecutions before the High Court proceed on indictment at the instance of the Lord Advocate, a member of the Scottish Government. The responsibility for and legal custody of a prisoner rests with the Scottish Ministers (previously the Secretary of State). The “punishment part” of a life sentence is fixed by the court. After expiry of the punishment part, the Scottish Ministers are obliged to refer the case to the Parole Board for it to consider whether or not it is appropriate for the prisoner to be released on licence. The Scottish Ministers are obliged to release a prisoner on licence if directed so to do by the Parole Board. It is therefore the Scottish Ministers, and in certain cases the Parole Board, which have responsibility for the detention or release of the prisoner. While the local authority may have a role to play in a prisoner’s rehabilitation, it plays no part in the detention of the prisoner and therefore had no need to justify its conduct under reference to article 5.
 Ms Irwin went on into make detailed submissions about the various statutes to which Mr Leighton had referred and argued, in general, that the first respondents were under no obligations in this case to provide housing or make other arrangements. In light of the decision at which I have arrived in this case, I need not go into the detail of these submissions.
Discussion and decision
 These submissions presented to me on both sides have been detailed and wide-ranging, but ultimately the point I have to decide is a fairly short one. The petitioner’s case as presented in the petition is that the Haney duty applies to the local authority as well as to the Scottish Ministers. The argument founds upon the fact that the local authority has a significant part to play in some aspects of a prisoner’s journey through the prison system and towards rehabilitation. That fact is not in dispute. It is also heavily reliant on the proposition that in order for the Haney duty to be effective it should be held to apply to the first respondents, the local authority, because of that very fact, that they are involved in a real and practical sense with a prisoner’s rehabilitation and supervision outwith prison. I take this formulation from statement 23 of the petition, but nothing turns on the precise wording. Underlying the submission is the obvious fact that the first respondents are a public authority and are bound to act in accordance with Convention rights: section 6 of the Human Rights Act 1998. Putting the matter another way, the petitioner says that there would be little purpose in imposing the Haney duty on the Scottish Ministers if it did not also apply to other public authorities involved with them in the whole rehabilitation process. There would be gaps; and there would be uncertainty as to where and on whom the onus lay to act in a particular way. Mr Leighton referred, as an example of this, to my decision in Reid v Scottish Ministers  CSOH 84 where the question arose as to the duties incumbent on the prison Governor when a local authority failed to accept responsibility for the petitioner upon his release.
 I am not persuaded that the first respondents, the local authority, owe any such duty. It is not in dispute that the first respondents are a public authority and are obliged to act in a manner which is not incompatible with Convention rights. But that does not advance the argument. The Haney duty is not a freestanding duty arising out of article 5. Rather it is imposed on the state in circumstances where the state has detained the prisoner and relies upon the justification in article 5(1)(a) (conviction and sentence by a competent court). Since part of the purpose of the sentence is rehabilitation, it is implicit in article 5 that the state, which is responsible for his detention, must provide the prisoner with a reasonable opportunity to rehabilitate himself and to demonstrate that he no longer presents an unacceptable danger to the public. But the local authority is in an entirely different position. It has no role in the detention or release of the prisoner. It is only role is to provide assistance in some parts of the rehabilitation process, both before and after release. Not being in the position of having to justify detention of the prisoner, there is no reason to impose on it the duty associated with that position.
 Mr Leighton referred to my decision in Reid v Scottish Ministers. But that does not assist him. In that case I expressed the view that the duty on the Scottish Ministers, via SPS and/or the prison Governor, as part of their Haney duty, was to take reasonable steps to procure the cooperation of the local authority to the extent that that cooperation was required: see para . This, to my mind, reflects the true position. The involvement of the local authority in the rehabilitation process occurs in a variety of situations. It provides social workers to work within the prison. Of more direct relevance to the present case, it provides assistance, advice and supervision outwith the prison in respect of prisoners who are seeking to take the opportunity to rehabilitate themselves in the period leading up to their potential release on licence. In doing so, the local authority provides a service to Scottish Ministers. That is the position as described in para 5 of the 2004 National Objectives document to which I have referred. Any duty owed by the local authority in this context – and I do not need to consider the extent of any such duty since the point is not before me and I have not heard submissions on it – is owed to the Scottish Ministers, not to the individual prisoner.
 I have not overlooked the fact that the local authority is under certain duties under particular statutes, such as the Social Work (Scotland) Act 1968 and the Housing (Scotland) Act 1987. But this does not assist the argument. Insofar as duties are owed under those particular Acts, and insofar as there are breaches of those duties, the petitioner will have grounds for complaint which he can vindicate in court. Those duties, such as they are, need no assistance and gain nothing from any more general duty imported from Haney. And as Ms Irwin pointed out, there are no averments in the petition indicating any breaches of specific duties under those statutes. In those circumstances I do not propose to consider the extent of the local authority’s obligations thereunder. They are what they are, and any issues arising in relation to them must await a case where there are relevant averments of breach.
 For these reasons the petitioner’s case as against the first respondents is irrelevant. I shall refuse the petition as against the first respondents. I shall appoint the case to come out By Order on a date to be afterwards fixed to determine further procedure. I reserve meantime all questions of expenses.