Page MenuHomePhabricator

Improve Block handling where User::isBlocked() was used previously
Closed, ResolvedPublic3 Story Points

Description

Problem
User::isBlocked() was deprecated in T209004 but the uses in core were replaced with User::getBlock() which is not always appropriate

Solution
Audit previous usages of User::isBlocked() and replace with the appropriate replacement.

Current patch makes the following changes:

  1. Users are only blocked from autopromote if their block is sitewide
  2. Users are only blocked from deleting revisions of a page if they are blocked from it
  3. Users are only blocked from editing page tags if (1) they are blocked from it, or (2) $wgBlockDisablesLogin is true and a logged out user cannot perform the tagging action in question
  4. Users who can normally unblock themselves cannot unblock themselves if their block applies to the unblockself right

Details

Related Gerrit Patches:

Event Timeline

dbarratt created this task.Apr 23 2019, 5:44 PM
Restricted Application added subscribers: MGChecker, Aklapper. · View Herald TranscriptApr 23 2019, 5:44 PM

Change 494497 had a related patch set uploaded (by Dbarratt; owner: Dbarratt):
[mediawiki/core@master] Deprecate User::isBlocked()

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

@dbarratt Should this be moved to the sprint?

Uhhh... I need to update it since we've changed our direction

dbarratt renamed this task from Remove use of User::isBlocked() from core to Improve Block handling where User::isBlocked() was used previously.Apr 30 2019, 12:53 AM
dbarratt updated the task description. (Show Details)
dbarratt set the point value for this task to 3.May 7 2019, 10:30 PM

The current patchset (PS22) makes the following changes:

  1. Users are only blocked from autopromote if their block is sitewide
  2. Users are only blocked from deleting revisions of a page if they are blocked from it
  3. Users are only blocked from editing page tags if (1) they are blocked from it, or (2) $wgBlockDisablesLogin is true and a logged out user cannot perform the tagging action in question
  4. Users who can normally unblock themselves cannot unblock themselves if their block applies to the unblockself right

Should we discuss these here? I'm thinking to include @Niharika and @SPoore in the conversation.

It might be easier to move forward with these if they were separate patches/tasks...

Niharika triaged this task as Normal priority.Jun 5 2019, 6:24 PM
Niharika moved this task from Cards ready for development to Lāmed - ל on the Anti-Harassment board.
Niharika edited projects, added Anti-Harassment (Lāmed - ל); removed Anti-Harassment.

I can't remember if we said we'd split this up, but if so then the tagging is already filed as T221444

I can't remember if we said we'd split this up, but if so then the tagging is already filed as T221444

We said we'd split the patches but keep the same ticket with a complete description of changes we are making. Copying your last comment in the ticket description for that.

Niharika updated the task description. (Show Details)Jun 5 2019, 9:28 PM
dbarratt claimed this task.Jul 18 2019, 5:31 PM
dbarratt moved this task from Ready to In Progress on the Anti-Harassment (The Letter Song) board.

Change 494497 abandoned by Dbarratt:
Improve Block handling where User::isBlocked() was used previously

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

dom_walden added a subscriber: dom_walden.

There does not appear to be any testing necessary for this task on its own.

Testing will/has been done as part of the child tasks.

dbarratt closed this task as Resolved.Sep 16 2019, 4:32 PM
dbarratt reopened this task as Open.
dbarratt closed this task as Resolved.