while testing and trying to understand the newly introduced capabilty, I stumbled over this.
Status quo and problem
By default the capability moodle/site:messageanyuser is given to the roles Manager, Teacher and Non-editing teacher.
The capability has the effect that this user can text to users even if they were blocked. For example. User A is teacher in course X. User B, enrolled as student in course X does not want to receive messages from his teacher and therefore he blocks user A. Then A can still send messages to B. This is absolutely okay, because teachers should be able to text their students in all means.
We're just struggling with the unexpectedness of this feature for the student B. He thought that he has blocked A and is confused why he still receives messages and the conclusion might be that he thinks that there's a bug and blocking is not working.
Steps to reproduce
- Having users A and B in your system
- Make sure that moodle/site:messageanyuser is given to teachers
- Go to a course X (or create one) and enrol user A as teacher and user B as student
- Login as user B, open the messaging interface and search for user A
- In the list, klick on the three dots for user A and klick on context menu item "Block user"
- Confirm the blocking action by clicking the button "Block"
- Verify that you see the information "You have blocked this user in the past" with the button "Unblock user"
- Login as user A
- Open the messaging interface and search for user B
- Make sure that you have the messaging text area
- Enter a message and send it to user B
- Login as user B and see that he's got a new message from user A and the blocking icon is shown after the name of user A
So we're proposing to make this more transparent for the users:
- If a user wants to block a user that has the capability moodle/site:messageanyuser, the dialogue "Are you sure you want to block XY?" could be altered to something like this:
"Are you sure you want to block XY? Attention: Currently the block won't have any effect, because XY has permissions to contact you though."
- The information that the block currently has no effect should be displayed in the user list, too. For example the strike through icon could be grayed out and some textual explanation could be added. For example something like this (inactive is probably not the correct term, but it should only serve visual support here):
We think with this changes the user should be clear about the status of the blocking action and should not wonder or assume a bug if a user with the capability sends him a message though.