19 month old?

My son is 19 months old. We had to convert his crib to a toddler bed because of his safety. (He would crawl out of his crib) we did this tonight but found out my boyfriend, my sons father, put a twist and grip door knob cover on the inside of his bedroom doorknob so he cannot get out of his room. He more than likely would try and roam the house at night if he did get out but we would hear him and put him back to bed. I do not think its ok to pretty much lock him in his bedroom. Am I wrong? Would you or have you done this?