We're experimenting with parental access in my institution. Due to safeguarding/data protection responsibilities, one of the requirements is that a Parent account musn't be able to see the names of any other student than that to which they are assigned as parent.
By creating a "Restricted User" system role as well as the parent role, I've been able to remove things like access to profiles, and I can prevent them being able to send messages (by prohibiting moodle/site:sendmessage), but I can't seem to stop them accessing the messaging system altogether. This means that they can click the Messages link on their profile, then view what would be the messaging history between them and any user by editing the ID in the URL. Attempting to access a user's profile page via the same method results in an "access denied" type message.
Is there any way to do this without modifying core code? If not, I'd like to propose a new capability along the lines of moodle/site:viewmessagehistory that controls access to this page.