Page MenuHomePhabricator

Provide an option to prevent a user from signing up as a mentor
Closed, ResolvedPublic

Description

At mediawikiwiki, @Iniquity wrote:

I have a partially blocked mentor who I want to exclude from mentoring/change his status to away and make sure he can't come back. There is a possibility?

Some communities may have decided to prevent someone from being a mentor. But at the moment, there is no mechanism that can allow this community to block a user from being a mentor.

In this task, we decided to do that via partial blocks (admins should be able to partially block a mentor from MediaWiki:GrowthMentors.json, with the expected consequences [mentors can't sign up/quit/etc]).

Acceptance criteria
  • When a mentor is partially blocked from MediaWiki:GrowthMentors.json, they cannot enroll as mentors/quit as mentors/change their mentor status, so communities have control on who can enroll.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

A user right could be assigned to all registered users, and then revoked from a group, similarly to how IP Info implements revoking access to the tool from users (see Special:ListGroupRights#no-ipinfo). This group could be assigned to users who should not be mentors (probably by admins, not bureaucrats, as this is a kind of block).

The easiest solution at this point would be to make use of partial blocks. There are two options we can consider:

  1. Add a new "Prevent this user from becoming a mentor" option to Special:Block (a mockup of how that can look like is at F35689278)
  2. Currently, partial blocks are ignored by the mentorship features. We can respect a partial block of MediaWiki:GrowthMentors.json page. Users blocked from that page would not be able to become mentors, edit their message or similar.

The second solution is technically significantly easier to implement (it involves no change of the blocks ecosystem; only the interpretation of a block changes). The first solution would require us to somehow change Special:Block (which probably would require coordination with Anti-Harassment, and we might have to wait for Action Blocks to come out of beta).

The user right, as @Tacsipacsi mentions, is also a possible solution. I believe we shouldn't go that route though – traditionally, user rights exist to grant new rights, rather than to remove rights from users.

@Trizek-WMF @Iniquity @Tacsipacsi If you have any thoughts on any of the solutions mentioned above, I'm happy to hear them!

  1. Currently, partial blocks are ignored by the mentorship features. We can respect a partial block of MediaWiki:GrowthMentors.json page. Users blocked from that page would not be able to become mentors, edit their message or similar.

I like this idea. The first thing I went to check was whether blocking the mediawiki would affect the ability to add myself as a tutor. This can be used as a first approximation solution, and then improved upon. But the question is, will this affect the ability to change the status?

The user right, as @Tacsipacsi mentions, is also a possible solution. I believe we shouldn't go that route though – traditionally, user rights exist to grant new rights, rather than to remove rights from users.

I don’t say that we should definitely go that route, but the possibility to revoke rights (introduced in bed5f5d54e33 by @Skizzerz) probably exists for a reason.

$wgRevokePermissions has always been a very niche feature. I introduced it in conjunction with APCOND_BLOCKED so that blocked users could be "autopromoted" into a group that further restricts their access beyond what a normal block would. The partial block feature didn't exist back then, and APCOND_BLOCKED only interacts with sitewide blocks at the moment, so it's not particularly ideal for this feature.

Being manually added to the group with an expiration time could serve as a "block" of sorts, but it is stored in the user rights log rather than the block log, which is rather unintuitive (the point of the autopromote addition was so that any "blocking" type things show up as, well, blocks). However, temporary group memberships with negative permissions is doable from a technical standpoint without requiring any new coding effort in either core or the extension.

My apologies if I was not clear – $wgRevokePermissions is certainly a way that would work, I just don't feel that's the right way (as it's unintuitive, at the very least).

Thank you for all the suggestions. At some point, we have to find the most common path, though. What action do an admin usually take to block a user from doing something? They use Special:Block.
I think we should go with a solution that is natural to every admin. Removing a right, or blocking chat looks to be an unrelated page aren't really natural paths, I'm afraid.

Thank you for all the suggestions. At some point, we have to find the most common path, though. What action do an admin usually take to block a user from doing something? They use Special:Block.
I think we should go with a solution that is natural to every admin. Removing a right, or blocking chat looks to be an unrelated page aren't really natural paths, I'm afraid.

I want to point out that managementors right can be recieved not only by admins in future.

  1. Add a new "Prevent this user from becoming a mentor" option to Special:Block (a mockup of how that can look like is at F35689278)

No more checkboxes on the block form please, it is enough of a confusing mess already.

Just tell the person they are not allowed to enroll as a mentor, and if they do anyway, someone can sitewide-block them.

  1. Currently, partial blocks are ignored by the mentorship features. We can respect a partial block of MediaWiki:GrowthMentors.json page. Users blocked from that page would not be able to become mentors, edit their message or similar.

I think that would make sense in general, regardless of how well it solves this use case. When someone enrolls as a mentor, they make an edit to that page. Making edits to it while being blocked from doing so would be suprising behavior.

I think we have consensus to implement partial blocks here. It's up to further discussion whether we want to do anything else.

Change 923742 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] Respect partial blocks for GrowthMentors.json in structured mentor list

https://gerrit.wikimedia.org/r/923742

Change 923742 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Respect partial blocks for GrowthMentors.json in structured mentor list

https://gerrit.wikimedia.org/r/923742

@Urbanecm_WMF - so far I've tested the following case on testwiki wmf.17 when an existing mentor was partially blocked. Please review the results. I'll do more testing for the following cases and will update later:

  • a user (non-mentor) is partially blocked from MediaWiki:GrowthMentors.json page
  • a mentor is blocked sitewide
  • a non-mentor is blocked sitewide

(1) Existing mentor is partially blocked from MediaWiki:GrowthMentors.json page

ActionsCan do ✅ /Cannot do ❌
see Special:MentorDashboard
Change Mentor status
Claim mentee
change settings for Send praise
Change Number of mentees assigned to me
Screen Shot 2023-07-14 at 5.01.41 PM.png (780×1 px, 110 KB)
Change Message to your mentee
Screen Shot 2023-07-14 at 5.02.10 PM.png (1×1 px, 133 KB)
Quit mentorship
Screen Shot 2023-07-14 at 5.03.26 PM.png (900×2 px, 150 KB)

@Urbanecm_WMF - I re-checked the above test cases (except for sending praise) - all results are the same.
Specifically,

  • a mentor is blocked via Special:Block
  • the block is partial - in Pages I entered: MediaWiki:GrowthMentors.json
  • no other settings were changed except un-checking "Automatically block the last IP address used by this user [...]"

When a mentor is partially blocked from MediaWiki:GrowthMentors.json, they cannot enroll as mentors/quit as mentors/change their mentor status, so communities have control on who can enroll.

The three specs in the scope of this tasks were checked

A partially blocked user (blocked from MediaWiki:GrowthMentors.json) cannot enroll as mentors
Screen Shot 2023-09-24 at 9.39.25 AM.png (796×2 px, 141 KB)
A partially blocked mentor (blocked from MediaWiki:GrowthMentors.json cannot quit mentorship
Screen Shot 2023-09-24 at 9.46.57 AM.png (764×1 px, 106 KB)
A partially blocked mentor (blocked from MediaWiki:GrowthMentors.json cannot change their mentor status
Screen Shot 2023-09-24 at 9.46.18 AM.png (322×782 px, 27 KB)

All specs for the task are done. The error messaging could be improved - filed as a separate ticket - T347247: Blocked mentors - error messages need improvement