The Captain might be applying common sense over rules Bigears, but he is in breach of DFT directives that say the locked door is not to be opened to anyone unauthorised inflight.
The problem is tiggerific_69 if you report the captain, you will also be in the brown stuff as you complied with the captains instruction when you know full well that NOBODY is allowed in the flight deck unless they are operating crew.
I personally wouldn't report the captain, but I would make sure that in future if I was in that situation that I informed the captain that it is against not just company SOP's but also the DFT rules that have to be followed and I would respectfully inform him that the lad will visit the flight deck on arrival - if the captain didn't like that, well tough on the captain as you are complying with established rules which must not be deviated from!