I think it depends on the hospital and individual nurses - but I don't think they can truly stop you from co-sleeping, yk?
I've had four babies (all c-sections) in 2 different hospitals (with a handful of nurses between all the shift changes during the 3-day stays. All four slept on my chest, all night long.
I wouldn't have had it any other way. I had a couple nurses comment, but no one made
me put the baby in a plastic box. I think it helped that DH stayed with me each night, so they didn't worry about me being unable to put the baby down (again, surgical births) or anything. In my situation, I was in an adjustable, single bed in a semi-upright position so I was super comfy with baby on my chest - nursing when needed. Some rooms have double beds, and some don't - so that's something you may want to consider.