Remember Me - S4-E5
Other mistake: Toward the end, Beverly gets in the turbo lift to go to Engineering. As it starts, you see the lights to her left strobe top down. This is to indicate movement. However, since the lift was at the bridge level, the lights should have gone from bottom up, showing that the lift is going down.
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.