Well under rules forced on us by our yank masters the cockpit security check must be done before the boarding. The Flight crew are responible for that , not the engineers or anyone else.
EG Very easy for a disgruntled Engineer to drop a stroppy pilot in the sh1t by letting them board and secreting something whilst the captain has responsibility, and then informing DFT anonymously.
Not that I expect the yanks to adhere to anything. Just look at the Junpseat. Free use of it for crew in the states and bugger all in Puppet sates such as the UK.