So, for not being able to view all users of the course, the "supervisor" should have the "non editing teacher" role (or you should remove the "view all groups" permission for the role he has).
Thank you for your help. But i tried assigning the role of non editing teacher and when i login i can still see all users group different groups enrolled on a particular course. What i really want is to have like 10 users. Group1 have 6 student with 1 teacher and group 2 to have 2 student with 1 teacher. But the teachers should be restricted to view only participant only in there group.
By rereading carrefully, i better understand what you mean, being (not) able to view enrolled students in the course if they're not in the same group(s) as the non editing teacher.
It's not done exactly that way actually.
But if, as a non editing teacher, you go to an activity where setting specifies "separate groups", you wont see other (peoples) groups in this activity.
If you (as teacher/admin) open course setting, and define the whole course with "separate groups", and force it (for the whole course), the non-editing teacher will then only see people for his groups in the participants list