Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
You do not have to push away anyone who passes in front of you if you are praying behind the imam, and there is no sin on the person who passes in front of the row if this is done for a reason.
Answering your question, the Fatwa Center at Islam Q and A, states:
A person’s prayer is invalidated if a woman, donkey or black dog passes in front of him. It was reported from `Abd-Allah ibn al-Samit that Abu Dharr said: “The Messenger of Allah (peace be upon him) said: ‘If any one of you stands up to pray, then he has a sutrah [an item placed in front of a praying person as a “screen”] if he has something the height of the back of a saddle in front of him. If he does not have something the height of the back of a saddle in front of him, then his prayer is invalidated if a donkey or a woman or a black dog passes in front of him.’” I [‘Abd-Allah] asked, “O Abu Dharr, what is the difference between a black dog and a red or yellow dog?” He said, “O son of my brother, I asked the Messenger of Allah (peace be upon him) the same question, and he said, ‘The black dog is a shaytan (devil).’” (Muslim)
The height of the back of a saddle is one cubit or 2/3 of a cubit.
But this ruling applies only when one of these three pass in front of the imam or a person who is praying on his own, not when they pass between the rows of a congregation praying behind the imam during prayer in congregation, as the sister who asked the question thinks.
The evidence for that is the report in which ‘Abd-Allah ibn ‘Abbas said: “I came along riding on a female donkey one day when I had just reached the age of puberty. The Messenger of Allah (peace be upon him) was leading the people in prayer in Mina, without any kind of wall in front of him. I passed in front of part of the row, then I got down and sent the donkey to graze, and joined the row, and no one rebuked me for that.” (Al-Bukhari and Muslim)
Imam Al-Bukhari gave this hadith the heading of “Sutrat al-Imam sutrat man khalfahu (the sutrah of the imam is the sutrah of those behind him).” This hadith clearly proves our point, which is that the person who is praying behind the imam does not have to have a sutrah, and it does not matter what passes in front of him, especially since Ibn ‘Abbas passed in front of them with his donkey, which is one of the things which invalidates prayer if it passes in front of the imam or a person who is praying on his own.
Ibn `Abd al-Barr said:
This hadith – i.e., the hadith narrated by Al-Bukhari and Muslim from Abu Sa`eed al-Khudri which says “If any one of you is praying, he should not let anyone pass in front of him. Let him push him away as much as he can, and if he insists then let him fight him, for he is nothing but a shaytan (devil)” – indicates that it is makruh to pass in front of a person who is praying if he is praying on his own and without a sutrah. The same ruling applies to the imam if he is praying without a sutrah.
But with regard to the person who is praying behind the imam, it does not matter what passes in front of him, just as it does not matter what passes in front of the imam or person praying alone if it passes behind the sutrah. The sutrah of the imam is also the sutrah of those who are praying behind him.
We say this concerning the imam and the person who prays alone, because the Prophet (peace be upon him) said, “If any one of you is praying…” According to the scholars, this means praying on his own, because of the hadith of Ibn `Abbas. Hence we say that the person who is praying behind the imam does not have to push away the person who passes in front of him, because Ibn ‘Abbas said: “I came along riding on a female donkey one day when I had just reached the age of puberty. The Messenger of Allah (peace be upon him) was leading the people in prayer in Mina, without any kind of wall in front of him. I passed in front of part of the row, then I got down and sent the donkey to graze, and joined the row, and no one rebuked me for that.” (Al-Tamheed, 4/187)
On this basis, the sister who asked this question, and other people, do not have to push away anyone who passes in front of them if they are praying behind the imam, and there is no sin on the person who passes in front of the row if this is done for a reason. Pushing a person away and preventing them from passing in front is to be done by the imam or the person who is praying alone, if a person wants to pass between him and his sutrah.
Almighty Allah knows best.
Source: https://islamqa.info/en/3404