You're getting confused. The commander has the ultimate authority to ensure the safety of the aircraft and anyone or anything carried on it. In my OPS manual it states that I have this responsibility from the moment I arrive on board to the time I get off (it's a company confidential document so no, I won't show you but I'm sure a judge would be able to sneak a peek). Not, as you state, ultimate authority.
The cabin crew have no legal authority but may only initiate an evacuation if the situation in the cabin is clearly catastrophic.
If I consider your drug and alcohol tester to be detrimental to flight safety then I can have him removed.