Although incarceration or pretrial detention is necessarily accompanied by the loss or restriction of certain rights and privileges, including the right to privacy, an inmate retains those constitutional rights that are not inconsistent with prisoner status.