I'm trying to prevent students from seeing certain custom roles available in our site (3.4.3) when they view the participants list in a course. I've dug around a bit and currently this doesn't seem to be possible. I know I can specify which roles are visible in profiles (at Site admin > Security > Site security settings > Profile visible roles) but this doesn't prevent students from seeing users assigned to courses in these roles; just the role they are assigned in.
I also note a completed tracker item that limits students from seeing these roles on the course participants page (https://tracker.moodle.org/browse/MDL-59801) but to me it seems like that story missed the mark as I'm not sure what the use case would be for seeing a participant but then seeing 'No roles' listed for them in the role column.
Can anyone point me at a tracker item where the goal is "In the participants page, students should only see the users assigned in the roles listed in courseprofileroles"? If not I'll add that...