The man’s lawsuit says the acts were retaliatory because he took part in a class-action lawsuit against the prison.