Legal aspects of corrections management