HomePhabricator

Revert "Revert "Title::checkUserBlock should call User::isBlockedFrom for every…

Authored by Tchanders on Dec 6 2018, 8:35 PM.

Description

Revert "Revert "Title::checkUserBlock should call User::isBlockedFrom for every action""

This reverts commit 91fc7480301c8b2404cc280511c2fc83a6c3aa5d.

Hence it reapplies I6312a36911e5b73d773452fefef7ff25b9af08a4.

The changes made by this commit are (excluding the cases
checked for earlier):

  • An action can only be blocked if prevents() is true/null and

isBlockedFrom() is truthy. Previously, any action other than
'edit' or 'create' would be blocked if prevents() was true/null,
regardless of isBlockedFrom().

  • If an Action can be constructed, and requiresUnblock() is

false, the action won't be blocked. Previously, requiresUnblock()
wasn't checked.

This commit was previously reverted because it exposed that
EditEntityAction::requiresUnblock in Wikibase wrongly returned
false (fixed in I99061230023da2bbd0f98190a2907ca2e9717a4c).
Other potentially similar cases were audited in T211048.

Bug: T208862
Change-Id: If74a1d422290b8c62b7a7a8922621c73c9598269