Page MenuHomePhabricator

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 );
}

Event Timeline

dbarratt created this task.Nov 12 2018, 2:56 PM
Restricted Application added subscribers: MGChecker, Aklapper. · View Herald TranscriptNov 12 2018, 2:56 PM
dbarratt claimed this task.Nov 12 2018, 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.Nov 12 2018, 3:16 PM

Both reverts and patrol look good on thegoodplace wiki!

TBolliger triaged this task as Normal priority.Nov 19 2018, 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.Nov 19 2018, 11:33 PM
dbarratt moved this task from Review to Done on the Anti-Harassment (AHT Sprint 33) board.