Prisoners can now attend funeral of their close family members, High Court rules.