Continuity mistake: Data's insignia pips are backwards in the first scene as he is talking to Picard on the bridge.
Continuity mistake: When Deanna is trying to seduce Riker, she scratches him and there are three deep scratches on his neck. Later, when Doctor Crusher treats him, one of the scratches is now on his cheek, and only two are on his neck.
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.