Although we learnt in DS9 that all security/defense forces in the federation for every member world is Starfleet.
Which the Federation Council has complete power over, and local world governments can make reasonable requests of. Now a request vs an order isn't too difficult to tell which is more powerful, but the specific civilian authorities on any member world would have lateral, and equivalent powers to a highly starfleet officer, possibly that when the Prime Minister of Earth gives a star Ship Captain an "order" it's little difference to an Admiral laying down the law, although with all field orders, they have to eventually if not be quickly be ratified as legal orders back at Starfleet Command.
I remember once on the West Wing after someone was shot that a nurse tried to stop Josh from going to see one of the victims, and he says something like "Ma'am I have the Diplomatic clearance of a two star general, so please get the hell out of my way."
Who ruled Vulcan in TOS? Was T'Pau in charge or just Bossy?