You can limit teachers' access to the platform's data by using a feature called 'Teacher Restricted Mode'.
Go to Settings > General > Teacher Restricted Mode > Enabled to turn on this function.

Teachers won't have full access to all the student's data (such as attendance, leaves, and students' profile information) when this setting is enabled. The information about the students in that specific class will only be visible to the class teacher assigned to that class and the subject teachers of the topics assigned to that class.