Data's Day - S4-E11
Continuity mistake: At the end, Picard shows Data a baby born during the crisis. Neither of them touches it, but between shots, the baby's blanket changes positions. First it's almost completely covering his head and face, then it's pulled down and showing much more of him. (00:42:15)
Answer: Yes. The doors to the holodecks can be locked when in use by anyone aboard the Enterprise so they couldn't be disturbed. However, high ranking officers like Captain Picard could override the doors as it's seen that overrides are in use even for the crews quarters. Even Barclay, when he's indulging in one of his fantasies could have the doors to the holodeck unlocked by an override code.