
209 Kan. 383 (1972)
497 P.2d 273
ARTHUR L. HAMRICK, Appellant,
v.
JOHN C. HAZELET, Warden, Appellee.
No. 46,348
Supreme Court of Kansas.
Opinion filed May 6, 1972.
Maurice P. O'Keefe, Jr., of Atchison, argued the cause, and was on the brief for the appellant.
Patrick J. Reardon, County Attorney, argued the cause, and Vern Miller, Attorney General and John A. Price, Special Prosecutor, were with him on the brief for the appellee.
The opinion of the court was delivered by
PRAGER, J.:
This is an appeal from an order of the district court summarily dismissing a petition for a writ of habeas corpus filed by the appellant Arthur L. Hamrick, an inmate at the Kansas State Penitentiary, Lansing, Kansas. The respondent named in the petition is the warden of the penitentiary. The proceedings were instituted on May 22, 1970, by the pro se filing of a handwritten instrument designated as a "Petition for Writ of Habeas Corpus Ad Testificandum Pursuant to K.S.A. 60-1501."
In his petition the appellant complains that he has been placed in protective custody for a period of two years without benefit of working, or exercising, or other privileges that would contribute to his morale or rehabilitation. He further alleged that he has been denied adequate medical attention. Appellant describes with particularity that he has a crushed bone located in his nose which obstructs the nasal passages making breathing very difficult and painful and that the same has been in need of surgery which the institution has failed to provide. Appellant further complains in his petition that while confined in the Adjustment and Treatment Building (A & T) he had been denied personal cleanliness; work *384 programs; education and training; adequate food; and access to the inmate canteen, library privileges, handicraft programs, athletics, motion pictures, television, radio and religious services. Appellant further complains that he is only allowed one three-minute shower a week and furthermore that the warden, in violation of statutory standards, has failed to provide adequate food, light and heat, recreation facilities, sanitation facilities, medical attention, and an adequate guard system causing danger of beatings, sexual attacks and other types of intimidation. He alleges that these conditions just described constitute cruel and unusual punishment and that the respondent has arbitrarily and capriciously refused to respond to appellant's request for relief.
On the same day the petition was filed the trial court summarily dismissed the petition without affording the appellant an opportunity to appear and present evidence thereon. On June 10, 1970, appellant filed a notice of appeal. Counsel was appointed to represent him in the appeal which was perfected to this court.
The record discloses two basic points relied upon by appellant on this appeal.
(1) The trial court erred in holding that habeas corpus is available only to contest the legality of the detention and does not provide a remedy for review of the mode or conditions of confinement.
(2) The court erred in not affording appellant a hearing on his petition to determine whether the allegations of mistreatment contained therein were true, justifying judicial relief.
The appellant in his brief contends that his petition alleges facts which, if true, would entitle him to relief from the court. Appellant contends that he has been mistreated during the confinement in the penal institution, that his rights have been denied and that there are substantial issues of facts to be determined. He contends that habeas corpus is a proper remedy and that the trial court should have granted him a hearing and permitted him to present his evidence. The appellee contends that a petition for a writ of habeas corpus which attacks the mode or conditions of a confinement rather than the legality of the detention should not be cognizable in the state of Kansas and further that even if habeas corpus were the proper remedy, the factual allegations of the petition are insufficient to state a claim upon which relief may be granted. Hence it is argued that it was not error for the district court to deny summarily a full evidentiary hearing to appellant.
*385 We hold that the trial court was in error in holding that habeas corpus is available only to contest the legality of the detention and does not provide a remedy for review of the mode or conditions of confinement in our penal institutions. We further hold that the court erred in not affording appellant a hearing on his petition. This case is determined on the basis of Levier v. State, (46,390), 209 Kan. 442, 497 P.2d 265, where we held that an inmate confined in a penal institution retains all the rights of an ordinary citizen except those expressly, or by necessary implication, taken from him by law including entitlement to adequate food, light, clothing, medical care and treatment, sanitary facilities, reasonable opportunity for physical exercise and protection against physical or psychological abuse or unnecessary indignity. We further held in Levier that habeas corpus provides an appropriate remedy for inquiry into mistreatment alleged by an inmate of a penal institution. It is clear that the trial court was in error in summarily dismissing appellant's petition for a writ of habeas corpus for want of jurisdiction and in failing to provide appellant an evidentiary hearing on his petition. The judgment is reversed and the action is remanded to the trial court with instructions to provide appellant counsel and an evidentiary hearing on his petition.
