The Messenger of Allah ﷺ said, "Allah has set forth a parable: a straight path, with walls on either side, and in the walls are open doors, over which hang loose curtains. At the entrance of the path stands a caller who says, 'People, enter the path together and do not deviate.' Another caller calls from above the path, and whenever someone intends 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, the open doors are the things Allah 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."
عن رسول الله ﷺ قال: ضرب الله مثلا صراطا مستقيما وعلى جنبتي الصراط سوران، فيهما أبواب مفتحة، وعلى الأبواب ستور مرخاة، وعلى باب الصراط يقول: أيها الناس، ادخلوا الصراط جميعا، ولا تتعرجوا، وداع يدعو من فوق الصراط، فإذا أراد أن يفتح شيئا من تلك الأبواب، قال: ويحك، لا تفتحه، فإنك إن تفتحه تلجه، والصراط الإسلام، والسوران: حدود الله والأبواب المفتحة: محارم الله، وذلك الداعي على رأس الصراط: كتاب الله، والداعي من فوق الصراط واعظ الله في قلب كل مسلم.
Ahmad (17634), Tahawi in Sharh Mushkil (2142), and Hakim (1/73) all narrated it through various routes from Muawiya bin Salih, that Abdul-Rahman bin Jubayr told him, from his father, from Nawas bin Saman, and he related it. Its isnad is sahih. Hakim said, "Sahih according to the criterion of Muslim, and I know of no defect in it."