The office of Rishon Letzion was implemented under the Ottoman Empire, their job was to represent the Jews of the Old Yishuv, Palestine, then under the ottomans. Rishon Letzion was also known as a Chacham Bashi. And carried many similar day to day tasks.
My great-grandfather, although not the Rishon Letzion, was a Chacham Bashi, both for the Turkish Army, and later the Av Beis Din of his hometown under the Ottomans in Macedonia - later becoming the independent state of Yugoslavia. He was student of the first Rishon Letzion of Palestine HaRav Yaakov Meir.
His responsibilities included presiding over money matters in his Beit Din, marriages and divorce. He also was empowered with imposing fines upon those who transgressed Torah prohibitions. For example, when one person opened their store on shabbos, my grandfather placed a Cherem upon him until he paid a fine to the local Gemachim of the town.
The Government gave tremendous leeway for each religious court and leaders to preform their duties (Christian, Muslim sharia, and batei Dinim).
The entire idea of a Chacham Bashi was started by Sultan Mehemt II.
Eventually the office of Hacham Bashi and Rishon Letzion were combined. As opposed to the Chacham Bashi residing in Constantinople.
In the Ottoman Empire, and as such, the Hakham Bashi was the closest
thing to an overall Exilarchal authority among Jewry everywhere in the
Middle East in early modern times. They held broad powers to
legislate, judge and enforce the laws among the Jews in the Ottoman
Empire and often sat on the Sultan's divan.
The office also maintained considerable influence outside the Ottoman
Empire, especially after the forced migration of numerous Jewish
communities and individuals out of Spain (after the fall of Granada in
1492) and Italy.
In 1842, the position of "Hakham Bashi", Chief Rabbi of Constantinople
who represented the Turkish Jews before the Sultan, and the position
of Rishon LeZion which at that time already represented the Old Yishuv
before the Sultan, were combined into one position called Rishon