Our teacher, the Rema, wrote that the same law applies to a gabbai appointed by the townspeople, that he may change it for whatever communal needs appear to him. And the same law applies to an individual who volunteered tzedakah and gave it to a gabbai (to the fund). But if he himself appointed gabbaim—the townspeople cannot change it, for he did not volunteer based on their discretion. Similarly, if the donor specified and said they should give it to the poor of the city or to a certain poor person—they may not change it, even for Torah study. Thus far his words. And they challenged him, for a gabbai is not comparable to the community or the sage of the city, as they are permitted to change it even for a discretionary matter. However, the gabbai cannot change it except for a mitzvah matter, for so the poskim agreed. And so it implies in the first chapter of Arachin (Bach and Shach subsection 8, and the Gra subsection 9), unless the custom is such that the gabbai does whatever he wishes (Shach ibid.). For anyone who gives—gives based on the custom. And it appears to me that he was indeed precise in his words regarding the ruling of our teacher, the Beit Yosef, which deals with the fund of the townspeople, where all the townspeople appointed him as gabbai to be in place of all the townspeople, and consequently his power is as their power. And this is what he wrote: "And the same law applies to an individual who volunteered tzedakah and gave it to a gabbai," meaning: that the individual, aside from what he gives regularly according to the assessment, gave further to the city fund into the hand of the gabbai. For presumably he gave with this intention, that the gabbai shall do as he wishes. And regarding this he said, "But if he himself appointed gabbaim etc.," meaning: in a matter that did not enter the city's generalities, even the townspeople cannot change it, and all the more so the gabbaim. Similarly, "if the donor specified etc.," meaning: when he specified, even if he gave it to the city gabbai—it is forbidden to change it. And so it is explained in the Maharik (Root 5) that there is a distinction between one gabbai and another, see there. And so it is explained from the words of our teacher, the Rema, himself from what he wrote afterward, as will be explained in the next section with the help of Heaven.
וכתב רבינו הרמ"א דהוא הדין לגבאי הממונה מבני העיר, שיכול לשנות לכל מה שיראה לו מצרכי ציבור. והוא הדין ביחיד שהתנדב צדקה ונתנה לגבאי (לקופה). אבל אם מינה בעצמו גבאים – אין בני העיר יכולים לשנותה, דלא על דעתם התנדב. וכן אם פירש הנותן ואמר שיתנו לעניי העיר או לעני פלוני – אין להם לשנות, אפילו לתלמוד תורה. עד כאן לשונו. והשיגו עליו דגבאי לא דמי לציבור ולחכם העיר, דהם רשאים לשנות אפילו לדבר הרשות. אבל הגבאי אינו יכול לשנות אלא לדבר מצוה, דכן הסכימו הפוסקים. וכן משמע בפרק קמא דערכין (ב"ח וש"ך סעיף קטן ח, והגר"א סעיף קטן ט), אם לא שהמנהג כן שהגבאי עושה כל מה שירצה (ש"ך שם). דכל הנותן – על דעת המנהג הוא נותן. ונראה לי דבאמת דקדק בדבריו על דינו של רבינו הבית יוסף דמיירי בקופה של בני העיר, שכל בני העיר מינו אותו לגבאי שיהיה במקום כל בני העיר, וממילא שכחו בכוחם. וזה שכתב: והוא הדין ביחיד שהתנדב צדקה ונתנה לגבאי, כלומר: שהיחיד לבד מה שנותן בתמידיות כפי ההערכה, עוד נתן לקופת העיר ליד הגבאי. דמסתמא נתן אדעתא דהכי, שהגבאי יעשה כרצונו. ולזה אמר "אבל אם מינה בעצמו גבאים וכו'", כלומר: בדבר שלא נכנס לכלליות העיר אין אף בני העיר יכולים לשנות, וכך שכן הגבאים. וכן אם פירש הנותן וכו', כלומר: כשפירש אפילו נתן לגבאי העיר – אסור לשנות. וכן מבואר במהרי"ק (שורש ה') שיש חילוק בין גבאי לגבאי, עיין שם. וכן מבואר מדברי רבינו הרמ"א עצמו ממה שכתב אחר כך, כמו שיתבאר בסעיף הבא בסייעתא דשמיא.