I have not found this specific topic elsewhere (at least not with the advanced search facility) at moodle.org
Is there a way (e.g. modifying the course/loginas.php file) to limit the 'login as' function to administrators only. Theoretically, we could be sued if teachers use this option, because the privacy of the students is protected by law. (Even the administrator is officially not allowed to use this function, but sometimes it is necessary to check a problem that a student may have from the view of the student.)
For the time being I have blocked the function crudely by disabling the cours/loginas file, but there should be a more graceful solution

Thanks beforehand for any suggestions,
Paul.