Charities have described a decision by the Supreme Court to turn down the appeal of a disabled ex-ballerina for an overnight carer as "shameful".
Elaine McDonald, 68, took Kensington and Chelsea Council to court over its decision not to provide her with a night carer to help her use a commode.
The court ruled the council had acted lawfully in reviewing her care plan.
Ms McDonald, from west London, who had a stroke in 1999, said the ruling was very upsetting.
The five-judge panel turned down her challenge by a 4-1 majority - described by Age UK as shameful.
The stroke left Ms McDonald - who was once a star of Scottish Ballet and received an OBE in 1983 - with reduced mobility and needing to use a wheelchair outside.
She appealed to the highest court in the UK after losing her case against the council at the Court of Appeal in London last October.Council 'reassessed' needs
Councillor Fiona Buxton, from Kensington and Chelsea Council, said the ruling showed it had acted fairly and appropriately.
She said: "It shows that we have to balance the needs of very many people we have to look after, when considering the needs of one person."
The council will save about £22,000 a year with the new care package.
Ruling, Justice of the Supreme Court Lord Brown said: "The majority of the court concluded that the appellant's needs had indeed been reassessed by the later care plan reviews."
Ms McDonald's claim that her right to dignity had been breached was also dismissed by the judges.
Michelle Mitchell, charity director at Age UK, which took the case to court, said: "Older people have a fundamental right to dignity and forcing someone to sleep in their own urine and faeces could not be more undignified.
"This judgement opens the door to warehousing older people in their own homes without regard to their quality of life."
Supreme Court judge Lady Hale, who said she would have allowed the appeal, said she was "troubled" by the ruling.
She said: "A person in her situation needs this help during the day as well as during the night and irrespective of whether she needs to urinate or to defecate.
"Logically, the decision of the majority in this case would entitle a local authority to withdraw this help even though the client needed to defecate during the night and thus might be left lying in her faeces until the carers came in the morning."
"Indeed, the majority view would also entitle an authority to withdraw this help during the day."'Significant setback'
Ms McDonald had claimed the care package she received should include assistance at night to use a commode.
She told a previous hearing she was not incontinent but had to use incontinence pads overnight, which was an "affront to her dignity".
John Wadham, group director at the Equality and Human Rights Commission, said the ruling was a "significant setback for people who receive care in their home".
"Local authorities will now have greater discretion in deciding how to meet a person's home care needs and will find it easier to justify withdrawing care.
"This means that older people's human rights to privacy, autonomy and dignity will often be put at serious risk.
"The court has missed a significant opportunity to interpret the law to protect some of the most vulnerable people in society," he said.
Joe Korner, director of communications at the Stroke Association, said more than one million people across the UK were living with the after-effects of a stroke.
He added: "We are very concerned about this judgement and call on councils to continue to provide vital services that help to preserve people's health, dignity and quality of life."