We have constellations in which we have a large number of students in a course, e.g. for teaching purposes.
The students should not be able to see who is enrolled in the course. For this reason, their right to view the list of participants is revoked.
In the course itself, the participants are connected to each other. They can therefore search for or find each other via the global messages.
This would make it possible to create larger lists of participants.
To prevent this, I have made a local customization (lib/enrollib.php - function enrol_get_shared_courses) and exclude the relevant courses in the SQL query.
An admin setting in the backend would be helpful for such constellations so that participants are not able to identify other participants.