An airline captain doesn't have absolute authority
I'm sorry Bealzebub, that was an inaccurate choice of words on my part, specifically the use of "absolute". Depending on company and country of registration of course he'll likely have authority from his company to deny entry to his flight deck to anyone on the authorised list, should he deem that necessary for reasons of safety, concentration, or anything else he himself deems important.
I think at least we're all agreed that his authority doesn't extend to overriding national law, generally speaking, when it comes to who may be authorised.