Action::checkCanExecute should only block an Action if the user is sitewide blocked
Closed, ResolvedPublic

Description

Problem
If an Action extends Action then users who are partially blocked are also blocked from performing that action.

if ( $this->requiresUnblock() && $user->isBlocked() ) {
  $block = $user->getBlock();
  throw new UserBlockedError( $block );
}

Solution
This should be changed to something like:

$block = $user->getBlock();
if ( $this->requiresUnblock() && $block && $block->isSitewide() ) {
  throw new UserBlockedError( $block );
}
dbarratt created this task.Mon, Nov 12, 2:56 PM
Restricted Application added subscribers: MGChecker, Aklapper. · View Herald TranscriptMon, Nov 12, 2:56 PM
dbarratt claimed this task.Mon, Nov 12, 3:00 PM
dbarratt moved this task from Ready to In progress on the Anti-Harassment (AHT Sprint 33) board.

Change 473024 had a related patch set uploaded (by Dbarratt; owner: Dbarratt):
[mediawiki/core@master] Action::checkCanExecute should only block an Action if the user is sitewide blocked

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

dbarratt renamed this task from Action::checkCanExecute should only block a Action if the user is sitewide blocked to Action::checkCanExecute should only block an Action if the user is sitewide blocked.Mon, Nov 12, 3:16 PM

Both reverts and patrol look good on thegoodplace wiki!

TBolliger triaged this task as Normal priority.Mon, Nov 19, 9:58 PM

Change 473024 merged by jenkins-bot:
[mediawiki/core@master] Action::checkCanExecute should only block an Action if the user is sitewide blocked

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

dbarratt closed this task as Resolved.