Preventing access to messaging system

Preventing access to messaging system

by Mark Johnson -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

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.

Average of ratings: -
In reply to Mark Johnson

Re: Preventing access to messaging system

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Actually, it strikes me that being able to view a message history including an name and photo for a user who's details you aren't allowed to view shouldn't happen.  moodle/user:viewdetails should take care of this as it does on user/index.php.  I've attached a patch which addresses this, does anyone have any comments before I submit it to the tracker?