Scotty Doo of course its a security risk telling anyone on a public forum at which stages of flight the flight deck door could expect to be opened and for what reason, and who are the ones to go in etc etc
Yes there is a lock - but like all doors, its needs to be opened occasionally