Page MenuHomePhabricator

'Thanks' are completely blocked when a user is partially blocked
Closed, ResolvedPublic2 Story Points

Description

Problem
The Thanks extension overly enforces partial blocks:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Thanks/+/f3d1aac4db93679d400c20b2274515d94913c718/includes/ApiThank.php#16

This prevents users who are partially blocked on a page or a namespace from sending a Thanks to anyone, anywhere on the wiki.

Solution
If a Thank is for a revision, then PermissionManager::isBlockedFrom() should be used to determine if the user is blocked from the Title of that revision.

If a Thank is for a non-revision (a log entry), then Block::isSitewide() should be used to determine if the user is blocked from the entire site, which would prevent the use from sending any Thanks.

Event Timeline

dbarratt created this task.Apr 18 2019, 1:38 PM
Restricted Application added a project: Growth-Team. · View Herald TranscriptApr 18 2019, 1:38 PM
Restricted Application added subscribers: MGChecker, Aklapper. · View Herald Transcript
Niharika triaged this task as Normal priority.Apr 18 2019, 6:10 PM
Niharika set the point value for this task to 2.
Tchanders moved this task from Ready to In Progress on the Anti-Harassment (Teth - ט) board.

Change 506706 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/Thanks@master] Allow partially blocked users to use Thanks

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

@dbarratt makes the point that currently Thanks doesn't check whether a user can edit their own talk page. Currently, if a user is sitewide blocked but can edit their own user talk page, they can't thank anyone on their own user talk page.

Since we're going to let partially blocked users thank on their own talk page if they're allowed to edit it, then arguably we should let sitewide blocked users do this too.

@Tchanders I think this should be a simple change, no? I was thinking we would just check PermissionManager::isBlockedFrom() instead of checking to see if the user is blocked?

@dbarratt Yes it's not too complicated - but means we can't check for the blocked user until we either know the page, or know that the action being thanked for doesn't relate to a particular page.

I'm mostly mentioning it here to document that there will be a change to the current behaviour for sitewide blocked users.

Change 506706 merged by jenkins-bot:
[mediawiki/extensions/Thanks@master] Allow partially blocked users to use Thanks

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

dom_walden added a subscriber: dom_walden.

While sitewide blocked I do not see any "Thank" links on the revision history of any page nor on Special:Log. I can thank revisions on my own User_talk, unless I am explicitly blocked.

While partial blocked I do not see "Thank" links in revision histories of pages and namespaces I am blocked. I can thank on other pages. I can thank on Special:Log, unless the log refers to a page I am blocked from (link does not appear).

I also tested that I could thank comments made on structured discussions on a user's own talk page, unless they are explicitly blocked from it.

dmaza closed this task as Resolved.Jun 3 2019, 4:32 PM