It was me, and there are three legitimate lines, the Dayan, Charlap, and Schneerson families all have confirmed claims to the throne, in a case of unclear succesion the Sanhedrin chooses from among the available candidates.
And even when (with Hashem's help) there is a restoration there will probably be some form of Democracy but it will obviously be restricted in who can vote of hold office, and the King and Sanhedrin will also have the appropriate powers.