The Messenger of Allah ﷺ said, "Allah has set forth a parable. There is a straight path, and on both sides of the path are two walls with open doors. Over the doors hang loose curtains. At the entrance of the path stands a caller saying, 'People, enter the path together and do not stray.' Another caller calls from above the path, and whenever someone tries to open one of those doors, he says, 'Woe to you, do not open it, for if you open it you will pass through.'The path is Islam, the two walls are the limits set by Allah Almighty, the open doors are the things Allah Almighty has forbidden, the caller at the head of the path is the Book of Allah , and the caller from above the path is the admonisher of Allah in the heart of every Muslim."
حدثنا الحسن بن سوار أبو العلاء حدثنا ليث يعني ابن سعد عن معاوية بن صالح أن عبد الرحمن بن جبير حدثه عن أبيه
عن رسول الله ﷺ قال ضرب الله مثلا صراطا مستقيما وعلى جنبتي الصراط سوران فيهما أبواب مفتحة وعلى الأبواب ستور مرخاة وعلى باب الصراط داع يقول أيها الناس ادخلوا الصراط جميعا ولا تتفرجوا وداع يدعو من جوف الصراط فإذا أراد يفتح شيئا من تلك الأبواب قال ويحك لا تفتحه فإنك إن تفتحه تلجه والصراط الإسلام والسوران حدود الله تعالى والأبواب المفتحة محارم الله تعالى وذلك الداعي على رأس الصراط كتاب الله عز وجل والداعي فوق الصراط واعظ الله في قلب كل مسلم
Its isnad is sahih. Hasan bin Sawwar is a well-known trustworthy narrator, and the hadith was graded sahih by Hakim (1/73), with Dhahabi concurring. Munziri attributed it in Targhib (3/243–244) to Tirmidhi, noting that he said it is hasan gharib.