Assume that there is a specific teacher that doesn't want to himself AND the students to be able to access the participants list of his (specific) course. In this case, the thing that I would do as an admin is the following:
- Go to go to the permissions at the course level (Courses -> **COURSE_NAME** -> Users -> Permissions)
- Filter for the moodle/course:viewparticipants ("View participants") capability.
- Remove the "Student" and "Teacher" roles from the "Roles with permission" column.
- Add the "Student" and "Teacher" roles to the "Prohibited" column, to be on the safe side.
It seems that this works for the "Student" role. When the user is logged in as a student, the "Participants" link is removed from the navigation drawer and even if the user tries to access the participants list via direct URL or via another link in the course menus, an error is shown and the user is notified that he lacks the "View participants" permission.
However, this method doesn't work for the "Teacher" role. A user with this role can still see the participants lists, although he officially lacks the permission to this in the course level.
Does anyone know how to solve this issue?