Regarding security issues

I have noticed that teacher of different classes are able to see the all the student is there anyway to get over it as i want teacher’s only see their student, for now i have off the permission of teacher’s to show student in that teacher is not able to see any of the student, but i want that teacher can see their student at-least