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

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!

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 moved this task from Review to Done on the Anti-Harassment (AHT Sprint 33) board.