I have found this ideal for giving cats access to (or from) a room that you don’t want the dogs in or out of.
I have a dog door, so obviously I don’t close the bedroom door, but once most of my dogs settle in for the night they don’t leave until we get up the next morning, although they do sometimes switch beds during the night. The only exception was Fletcher, who was, unlike most greyhounds, was very territorial and protective. If he heard a noise in the yard he would jump up off his bed, bolt out the dog door, and search for the noise. He made so much noise he never caught anything