Teachers unable to send messages to students - Sorry, but you do not currently have permissions to do that (Send messages to any user)

Teachers unable to send messages to students - Sorry, but you do not currently have permissions to do that (Send messages to any user)

by Matt Trumbull -
Number of replies: 2

Upon upgrading to Moodle 3.5.2 we are receiving the error Sorry, but you do not currently have permissions to do that (Send messages to any user) when a teacher or manager attempts to message students. This occurs when trying to message from the participants screen. 

The messaging system is enabled in Advanced features, the teachers have permissions to send messages to multiple recipients, and the default message outputs are enabled with email set as the permitted default for online and offline. 

Does anyone have a suggestion on what permission setting might cause this? Messaging was working prior to the update.

Average of ratings: -
In reply to Matt Trumbull

Re: Teachers unable to send messages to students - Sorry, but you do not currently have permissions to do that (Send messages to any user)

by Matt Trumbull -

I seem to have resolved this. It looks like you must have the moodle/site:sendmessage capability enabled for authenticated users in order for teachers and manages to send messages even though it was enabled for those roles. We were trying to limit it to where students and general users couldn't send messages. 

In reply to Matt Trumbull

Re: Teachers unable to send messages to students - Sorry, but you do not currently have permissions to do that (Send messages to any user)

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

To clarify, the user must have the capability "moodle/site:sendmessage" on the system context. There are multiple ways to control this. Granting this capability for the Authenticated user gives it to everyone. If you want to allow messaging to staff only, create a new role such as "Message sender" with the capability enabled (and unset it from all other roles). Assign the new role at Site administration > Users > Permissions > Assign system roles to staff members only. You can't simply use the Teacher role for this as that one is typically assigned on lower course level context, not globally. See e.g. https://docs.moodle.org/en/Context#Roles_and_contexts for details.

Average of ratings: Useful (1)