Page MenuHomePhabricator

Deprecate User::isBlocked()
Closed, ResolvedPublic

Description

The method User::isBlocked() attempts to answer two questions:

  1. Does the user have a block?
  2. Is the user prevented from performing this action?

The method can answer #1, but it cannot answer #2. Since User::getBlock() can also answer #1, this method is redundant. The method cannot answer #2 because there is not enough context in order to answer that question.

If access is being checked against a Title object, all access checks can be performed with PermissionManager::userCan() which will also check the user's blocks.

If performing all access checks is not desirable, using PermissionManager::isBlockedFrom() is also acceptable for only checking if the user is blocked. This method does not determine if the action is allowed, only that the user's block applies to that Title.

If access is being checked without an existing Title, User::getBlock() can be used to get the user's block. Then Block::appliesToRight() can be used to determine if the block applies explicitly to a right (or returns null if it is unknown or false if explicitly allowed). If the user is creating a new Title, but the text of the title is not yet known (as in the case of Wikibase), access should be checked with Block::appliesToNamespace().

Event Timeline

TBolliger moved this task from Snackbox to Triage/To be Estimated on the Anti-Harassment board.
TBolliger subscribed.
  1. Mark it as deprecated in the code
  2. Mark it as deprecated in the documentation
  1. Add deprecation note to release notes
aezell removed the point value for this task.
dbarratt removed dbarratt as the assignee of this task.
dbarratt moved this task from Ready to In progress on the Anti-Harassment (Dalet — ד) board.

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

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

There are many places where User::isBlocked() is used in production:
https://codesearch.wmflabs.org/deployed/?q=-%3EisBlocked%5C(%5C)&i=nope

I think we should try to remove as many of these as we can (and create tasks for the ones we don't understand). However, this increases the scope of this task.

Isn't the point of deprecation to give those maintaining aspects of the code time to fix their usages?

Could we allow time for that first and then potentially fix instances that appear to have been missed or just don't have owners in any way?

Isn't the point of deprecation to give those maintaining aspects of the code time to fix their usages?

Could we allow time for that first and then potentially fix instances that appear to have been missed or just don't have owners in any way?

Yes. However, we cannot throw the notice produced by wfDeprecated() until all instances in production have been removed: https://www.mediawiki.org/wiki/Deprecation_policy#Deprecation

Without that notice, it is just a documentation change (a soft deprecation) and we can choose to remove as many or as few of the uses as we want.

Thanks for the explanation. I should have read the policy.

Thanks for the explanation. I should have read the policy.

No problem. :) What do you think the scope of our deprecation should be?
Soft? If so, how much should we replace? or should we plan on a hard deprecation and replace every use that is in production?

By the policy, we have to do the soft deprecation first, so I'd start with that. Then, I'd start a list of files and line numbers (which could obviously change) here in this ticket. We can then decide how much of that we can tackle.

It does feel like we will have some wiggle room in the near future with regards to effort we can put toward this.

Method
    isBlocked
Found usages  (208 usages found)
    Method call  (208 usages found)
        mediawiki  (208 usages found)
            core/includes  (1 usage found)
                Autopromote.php  (1 usage found)
                    Autopromote  (1 usage found)
                        checkCondition  (1 usage found)
                            201 return $user->isBlocked();
            core/includes/api  (8 usages found)
                ApiBlock.php  (1 usage found)
                    ApiBlock  (1 usage found)
                        execute  (1 usage found)
                            46 if ( $user->isBlocked() ) {
                ApiQueryUserInfo.php  (1 usage found)
                    ApiQueryUserInfo  (1 usage found)
                        getCurrentUserInfo  (1 usage found)
                            129 if ( isset( $this->prop['blockinfo'] ) && $user->isBlocked() ) {
                ApiRevisionDelete.php  (1 usage found)
                    ApiRevisionDelete  (1 usage found)
                        execute  (1 usage found)
                            41 if ( $user->isBlocked() ) {
                ApiTag.php  (1 usage found)
                    ApiTag  (1 usage found)
                        execute  (1 usage found)
                            43 if ( $user->isBlocked() ) {
                ApiUnblock.php  (1 usage found)
                    ApiUnblock  (1 usage found)
                        execute  (1 usage found)
                            44 if ( $user->isBlocked() ) {
                ApiUndelete.php  (1 usage found)
                    ApiUndelete  (1 usage found)
                        execute  (1 usage found)
                            34 if ( $user->isBlocked() ) {
                ApiUpload.php  (1 usage found)
                    ApiUpload  (1 usage found)
                        checkPermissions  (1 usage found)
                            545 if ( $user->isBlocked() ) {
                ApiUserrights.php  (1 usage found)
                    ApiUserrights  (1 usage found)
                        execute  (1 usage found)
                            54 if ( $pUser->isBlocked() && !$pUser->isAllowed( 'userrights' ) ) {
            core/includes/changetags  (6 usages found)
                ChangeTags.php  (6 usages found)
                    ChangeTags  (6 usages found)
                        canActivateTag  (1 usage found)
                            976 } elseif ( $user->isBlocked() ) {
                        canAddTagsAccompanyingChange  (1 usage found)
                            485 } elseif ( $user->isBlocked() ) {
                        canCreateTag  (1 usage found)
                            1145 } elseif ( $user->isBlocked() ) {
                        canDeactivateTag  (1 usage found)
                            1048 } elseif ( $user->isBlocked() ) {
                        canDeleteTag  (1 usage found)
                            1261 } elseif ( $user->isBlocked() ) {
                        canUpdateTags  (1 usage found)
                            558 } elseif ( $user->isBlocked() ) {
            core/includes/mail  (2 usages found)
                EmailNotification.php  (2 usages found)
                    EmailNotification  (2 usages found)
                        actuallyNotifyOnPageChange  (1 usage found)
                            227 && !( $wgBlockDisablesLogin && $watchingUser->isBlocked() )
                        canSendUserTalkEmail  (1 usage found)
                            266 } elseif ( $wgBlockDisablesLogin && $targetUser->isBlocked() ) {
            core/includes/specialpage  (1 usage found)
                FormSpecialPage.php  (1 usage found)
                    FormSpecialPage  (1 usage found)
                        checkExecutePermissions  (1 usage found)
                            206 if ( $this->requiresUnblock() && $user->isBlocked() ) {
            core/includes/specials  (6 usages found)
                SpecialBlock.php  (1 usage found)
                    SpecialBlock  (1 usage found)
                        checkUnblockSelf  (1 usage found)
                            1110 if ( $performer->isBlocked() ) {
                SpecialContributions.php  (1 usage found)
                    SpecialContributions  (1 usage found)
                        getUserLinks  (1 usage found)
                            384 if ( $target->isBlocked() && $target->getBlock()->getType() != Block::TYPE_AUTO ) {
                SpecialEditTags.php  (1 usage found)
                    SpecialEditTags  (1 usage found)
                        execute  (1 usage found)
                            71 if ( $user->isBlocked() ) {
                SpecialRevisiondelete.php  (1 usage found)
                    SpecialRevisionDelete  (1 usage found)
                        execute  (1 usage found)
                            126 if ( $user->isBlocked() ) {
                SpecialUndelete.php  (1 usage found)
                    SpecialUndelete  (1 usage found)
                        loadRequest  (1 usage found)
                            98 if ( $this->isAllowed( 'undelete' ) && !$user->isBlocked() ) {
                SpecialUserrights.php  (1 usage found)
                    UserrightsPage  (1 usage found)
                        execute  (1 usage found)
                            155 if ( $user->isBlocked() && !$user->isAllowed( 'userrights' ) ) {
            core/includes/user  (3 usages found)
                User.php  (3 usages found)
                    User  (3 usages found)
                        getRights  (1 usage found)
                            3588 $this->isBlocked()
                        loadFromSession  (1 usage found)
                            1381 if ( $user->isBlocked() ) {
                        spreadAnyEditBlock  (1 usage found)
                            4480 if ( $this->isLoggedIn() && $this->isBlocked() ) {
            core/maintenance  (1 usage found)
                importImages.php  (1 usage found)
                    ImportImages  (1 usage found)
                        execute  (1 usage found)
                            214 if ( $user->isBlocked() ) {
            core/tests/phpunit/includes/user  (9 usages found)
                UserTest.php  (9 usages found)
                    UserTest  (9 usages found)
                        testAutoblockCookieInauthentic  (1 usage found)
                            846 $this->assertFalse( $user2->isBlocked() );
                        testAutoblockCookieInfiniteExpiry  (1 usage found)
                            742 $this->assertTrue( $user1->isBlocked() );
                        testAutoblockCookieNoSecretKey  (2 usages found)
                            882 $this->assertTrue( $user1->isBlocked() );
                            894 $this->assertTrue( $user2->isBlocked() );
                        testAutoblockCookies  (3 usages found)
                            620 $this->assertTrue( $user1->isBlocked() );
                            641 $this->assertTrue( $user2->isBlocked() );
                            657 $this->assertTrue( $user3->isBlocked() );
                        testAutoblockCookiesDisabled  (1 usage found)
                            697 $this->assertTrue( $user->isBlocked() );
                        testIpBlockCookieIgnoredWhenUserLoggedIn  (1 usage found)
                            1456 $this->assertFalse( $user->isBlocked() );
            extensions/AbuseFilter/tests/phpunit  (1 usage found)
                AbuseFilterConsequencesTest.php  (1 usage found)
                    AbuseFilterConsequencesTest  (1 usage found)
                        setUp  (1 usage found)
                            233 if ( $user->isBlocked() ) {
            extensions/ArticleFeedbackv5  (6 usages found)
                ArticleFeedbackv5.activity.php  (2 usages found)
                    ArticleFeedbackv5Activity  (2 usages found)
                        canPerformAction  (1 usage found)
                            543 return $user->isAllowed( self::$actions[$action]['permissions'] ) && !$user->isBlocked();
                        getActivityCount  (1 usage found)
                            284 if ( !$wgUser->isBlocked() ) {
                ArticleFeedbackv5.hooks.php  (1 usage found)
                    ArticleFeedbackv5Hooks  (1 usage found)
                        makeGlobalVariablesScript  (1 usage found)
                            329 $vars['wgArticleFeedbackv5Permissions'][$permission] = $wgUser->isAllowed( $permission ) && !$wgUser->isBlocked();
                ArticleFeedbackv5.render.php  (1 usage found)
                    ArticleFeedbackv5Render  (1 usage found)
                        isAllowed  (1 usage found)
                            1401 return $wgUser->isAllowed( $permission ) && !$wgUser->isBlocked();
                ArticleFeedbackv5.utils.php  (1 usage found)
                    ArticleFeedbackv5Utils  (1 usage found)
                        isFeedbackEnabled  (1 usage found)
                            128 $enable &= !$wgUser->isBlocked();
                SpecialArticleFeedbackv5.php  (1 usage found)
                    SpecialArticleFeedbackv5  (1 usage found)
                        isAllowed  (1 usage found)
                            878 return $user->isAllowed( $permission ) && !$user->isBlocked();
            extensions/ArticleFeedbackv5/api  (1 usage found)
                ApiArticleFeedbackv5.php  (1 usage found)
                    ApiArticleFeedbackv5  (1 usage found)
                        execute  (1 usage found)
                            39 if ( $user->isBlocked() ) {
            extensions/Babel/includes  (1 usage found)
                BabelAutoCreate.php  (1 usage found)
                    BabelAutoCreate  (1 usage found)
                        create  (1 usage found)
                              (1 usage found)
                                57 if ( !$user || $user->isBlocked() ) {
            extensions/BatchUserRights  (1 usage found)
                BatchUserRights_body.php  (1 usage found)
                    SpecialBatchUserRights  (1 usage found)
                        execute  (1 usage found)
                            62 if ( $user->isBlocked() ) {
            extensions/BlogPage/includes  (1 usage found)
                BlogPage.hooks.php  (1 usage found)
                    BlogPageHooks  (1 usage found)
                        allowShowEditBlogPage  (1 usage found)
                            61 if ( !$user->isAllowed( 'edit' ) || $user->isBlocked() ) {
            extensions/BlogPage/includes/specials  (1 usage found)
                SpecialCreateBlogPost.php  (1 usage found)
                    SpecialCreateBlogPost  (1 usage found)
                        execute  (1 usage found)
                            46 if ( $user->isBlocked() ) {
            extensions/BlueSpiceUserManager/src  (4 usages found)
                Extension.php  (4 usages found)
                    Extension  (4 usages found)
                        addUser  (2 usages found)
                            125 if ( $aMetaData['enabled'] === false && !$oUser->isBlocked() ) {
                            130 } else if ( $aMetaData['enabled'] === true && $oUser->isBlocked() ) {
                        editUser  (2 usages found)
                            257 if ( $aMetaData['enabled'] === false && !$oUser->isBlocked() ) {
                            262 } else if ( $aMetaData['enabled'] === true && $oUser->isBlocked() ) {
            extensions/Cargo/api  (2 usages found)
                CargoRecreateDataAPI.php  (1 usage found)
                    CargoRecreateDataAPI  (1 usage found)
                        execute  (1 usage found)
                            18 if ( !$wgUser->isAllowed( 'recreatecargodata' ) || $wgUser->isBlocked() ) {
                CargoRecreateTablesAPI.php  (1 usage found)
                    CargoRecreateTablesAPI  (1 usage found)
                        execute  (1 usage found)
                            18 if ( !$wgUser->isAllowed( 'recreatecargodata' ) || $wgUser->isBlocked() ) {
            extensions/CheckUser/includes/specials  (3 usages found)
                SpecialCheckUser.php  (3 usages found)
                    SpecialCheckUser  (3 usages found)
                        doIPUsersRequest  (1 usage found)
                            1284 if ( $this->getUser()->isAllowed( 'block' ) && !$this->getUser()->isBlocked() ) {
                        doMassUserBlock  (1 usage found)
                            260 if ( !$this->getUser()->isAllowed( 'block' ) || $this->getUser()->isBlocked()
                        doMassUserBlockInternal  (1 usage found)
                            313 if ( $u->isBlocked() ) {
            extensions/CodeReview/includes/ui  (3 usages found)
                CodeRevisionView.php  (3 usages found)
                    CodeRevisionView  (3 usages found)
                        canAssociate  (1 usage found)
                            315 return $wgUser->isAllowed( 'codereview-associate' ) && !$wgUser->isBlocked();
                        canPostComments  (1 usage found)
                            299 return $wgUser->isAllowed( 'codereview-post-comment' ) && !$wgUser->isBlocked();
                        canSignoff  (1 usage found)
                            307 return $wgUser->isAllowed( 'codereview-signoff' ) && !$wgUser->isBlocked();
            extensions/Comments/includes  (2 usages found)
                Comment.php  (1 usage found)
                    Comment  (1 usage found)
                        getVoteLink  (1 usage found)
                            505 if ( $this->getUser()->isBlocked() ) {
                CommentsPage.php  (1 usage found)
                    CommentsPage  (1 usage found)
                        displayForm  (1 usage found)
                            566 if ( $this->getUser()->isBlocked() == false && ( $this->allow == '' || $pos !== false ) ) {
            extensions/Comments/includes/api  (3 usages found)
                CommentDeleteAPI.php  (1 usage found)
                    CommentDeleteAPI  (1 usage found)
                        execute  (1 usage found)
                            12 $user->isBlocked() ||
                CommentSubmitAPI.php  (1 usage found)
                    CommentSubmitAPI  (1 usage found)
                        execute  (1 usage found)
                            11 $user->isBlocked() ||
                CommentVoteAPI.php  (1 usage found)
                    CommentVoteAPI  (1 usage found)
                        execute  (1 usage found)
                            9 $user->isBlocked() ||
            extensions/CommentStreams/includes  (3 usages found)
                ApiCSPostComment.php  (1 usage found)
                    ApiCSPostComment  (1 usage found)
                        execute  (1 usage found)
                            39 $this->getUser()->isBlocked() ) {
                CommentStreams.php  (1 usage found)
                    CommentStreams  (1 usage found)
                        initJS  (1 usage found)
                            211 $output->getUser()->isBlocked() ) {
                CommentStreamsHooks.php  (1 usage found)
                    CommentStreamsHooks  (1 usage found)
                        userCan  (1 usage found)
                            170 if ( $user->isBlocked() ) {
            extensions/ContentTranslation/api  (4 usages found)
                ApiContentTranslationDelete.php  (1 usage found)
                    ApiContentTranslationDelete  (1 usage found)
                        execute  (1 usage found)
                            19 if ( $user->isBlocked() ) {
                ApiContentTranslationPublish.php  (1 usage found)
                    ApiContentTranslationPublish  (1 usage found)
                        execute  (1 usage found)
                            149 if ( $this->getUser()->isBlocked() ) {
                ApiContentTranslationSave.php  (1 usage found)
                    ApiContentTranslationSave  (1 usage found)
                        execute  (1 usage found)
                            30 if ( $this->getUser()->isBlocked() ) {
                ApiContentTranslationToken.php  (1 usage found)
                    ApiContentTranslationToken  (1 usage found)
                        execute  (1 usage found)
                            15 if ( $user->isBlocked() ) {
            extensions/DeleteBatch  (1 usage found)
                DeleteBatch.body.php  (1 usage found)
                    SpecialDeleteBatch  (1 usage found)
                        execute  (1 usage found)
                            38 if ( $user->isBlocked() ) {
            extensions/Echo/includes  (1 usage found)
                Notifier.php  (1 usage found)
                    EchoNotifier  (1 usage found)
                        notifyWithEmail  (1 usage found)
                            44 ( $wgBlockDisablesLogin && $user->isBlocked() )
            extensions/EditAccount  (2 usages found)
                SpecialCloseAccount.body.php  (1 usage found)
                    CloseAccount  (1 usage found)
                        execute  (1 usage found)
                            80 if ( $user->isBlocked() ) {
                SpecialEditAccount_body.php  (1 usage found)
                    EditAccount  (1 usage found)
                        execute  (1 usage found)
                            76 if ( $user->isBlocked() ) {
            extensions/EducationProgram  (1 usage found)
                EducationProgram.hooks.php  (1 usage found)
                    Hooks  (1 usage found)
                        displayTabs  (1 usage found)
                            313 if ( $user->isAllowed( 'ep-enroll' ) && !$user->isBlocked() ) {
            extensions/EducationProgram/includes/api  (2 usages found)
                ApiDeleteEducation.php  (1 usage found)
                    ApiDeleteEducation  (1 usage found)
                        execute  (1 usage found)
                            50 if ( !$this->userIsAllowed( $params['type'], $params ) || $this->getUser()->isBlocked() ) {
                ApiRefreshEducation.php  (1 usage found)
                    ApiRefreshEducation  (1 usage found)
                        execute  (1 usage found)
                            34 if ( $this->getUser()->isBlocked() ) {
            extensions/EducationProgram/includes/specials  (1 usage found)
                SpecialEnroll.php  (1 usage found)
                    SpecialEnroll  (1 usage found)
                        execute  (1 usage found)
                            44 if ( $this->getUser()->isBlocked() ) {
            extensions/FanBoxes/includes/specials  (2 usages found)
                SpecialFanBoxAjaxUpload.php  (1 usage found)
                    SpecialFanBoxAjaxUpload  (1 usage found)
                        execute  (1 usage found)
                            102 if ( $user->isBlocked() ) {
                SpecialFanBoxes.php  (1 usage found)
                    FanBoxes  (1 usage found)
                        execute  (1 usage found)
                            56 if ( $user->isBlocked() ) {
            extensions/FileImporter/src  (1 usage found)
                SpecialImportFile.php  (1 usage found)
                    SpecialImportFile  (1 usage found)
                        executeStandardChecks  (1 usage found)
                            126 if ( $user->isBlocked() ) {
            extensions/FlaggedRevs/api/actions  (2 usages found)
                ApiReview.php  (1 usage found)
                    ApiReview  (1 usage found)
                        execute  (1 usage found)
                            40 if ( $this->getUser()->isBlocked( false ) ) {
                ApiReviewActivity.php  (1 usage found)
                    ApiReviewActivity  (1 usage found)
                        execute  (1 usage found)
                            40 if ( $user->isBlocked( false ) ) {
            extensions/FlaggedRevs/backend  (1 usage found)
                FlaggedRevs.hooks.php  (1 usage found)
                    FlaggedRevsHooks  (1 usage found)
                        checkAutoPromoteCond  (1 usage found)
                            1080 if ( $user->isBlocked() ) {
            extensions/GraphViz/includes  (1 usage found)
                UploadLocalFile.php  (1 usage found)
                    UploadLocalFile  (1 usage found)
                        isUploadAllowedForUser  (1 usage found)
                            84 if ( $user->isBlocked() ) {
            extensions/GWToolset/includes/Helpers  (1 usage found)
                WikiChecks.php  (1 usage found)
                    WikiChecks  (1 usage found)
                        isUserBlocked  (1 usage found)
                            144 if ( $specialPage->getUser()->isBlocked() ) {
            extensions/HAWelcome  (1 usage found)
                HAWelcome.class.php  (1 usage found)
                    HAWelcomeJob  (1 usage found)
                        run  (1 usage found)
                            68 if ( $this->mUser && $this->mUser->getName() !== $wgHAWelcomeWelcomeUsername && !$welcomeUser->isBlocked() ) {
            extensions/ImageRating/includes/specials  (1 usage found)
                SpecialImageRating.php  (1 usage found)
                    ImageRating  (1 usage found)
                        execute  (1 usage found)
                            67 if ( $user->isBlocked() ) {
            extensions/ImportFreeImages  (1 usage found)
                SpecialImportFreeImages.php  (1 usage found)
                    SpecialImportFreeImages  (1 usage found)
                        execute  (1 usage found)
                            57 if ( $user->isBlocked() ) {
            extensions/InteractiveBlockMessage  (1 usage found)
                InteractiveBlockMessageHooks.php  (1 usage found)
                    InteractiveBlockMessageHooks  (1 usage found)
                        parserGetVariable  (1 usage found)
                            40 if ( !$user->isBlocked() ) {
            extensions/LastUserLogin  (1 usage found)
                LastUserLogin.body.php  (1 usage found)
                    LastUserLogin  (1 usage found)
                        execute  (1 usage found)
                            46 if ( $wgUser->isBlocked() ) {
            extensions/LinkFilter/includes/specials  (3 usages found)
                SpecialLinkApprove.php  (1 usage found)
                    LinkApprove  (1 usage found)
                        execute  (1 usage found)
                            106 if ( $user->isBlocked() ) {
                SpecialLinkEdit.php  (1 usage found)
                    LinkEdit  (1 usage found)
                        execute  (1 usage found)
                            32 if ( $user->isBlocked() ) {
                SpecialLinkSubmit.php  (1 usage found)
                    LinkSubmit  (1 usage found)
                        execute  (1 usage found)
                            36 if ( $user->isBlocked() ) {
            extensions/LiveTranslate/api  (1 usage found)
                ApiImportTranslationMemories.php  (1 usage found)
                    ApiImportTranslationMemories  (1 usage found)
                        execute  (1 usage found)
                            21 if ( !$this->getUser()->isAllowed( 'managetms' ) || $this->getUser()->isBlocked() ) {
            extensions/Maintenance  (1 usage found)
                Maintenance_body.php  (1 usage found)
                    SpecialMaintenance  (1 usage found)
                        execute  (1 usage found)
                            39 if ( $user->isBlocked() ) {
            extensions/MarkAsHelpful/api  (1 usage found)
                ApiMarkAsHelpful.php  (1 usage found)
                    ApiMarkAsHelpful  (1 usage found)
                        execute  (1 usage found)
                            8 if ( $wgUser->isBlocked( false ) ) {
            extensions/MassEditRegex  (2 usages found)
                MassEditRegex.api.php  (1 usage found)
                    MassEditRegexAPI  (1 usage found)
                        edit  (1 usage found)
                            23 if ( $user->isBlocked() ) {
                MassEditRegex.special.php  (1 usage found)
                    MassEditRegexSpecialPage  (1 usage found)
                        execute  (1 usage found)
                            219 if ( $wgUser->isBlocked() ) {
            extensions/MediaWikiChat/includes/api  (2 usages found)
                ChatSendAPI.php  (1 usage found)
                    ChatSendAPI  (1 usage found)
                        execute  (1 usage found)
                            11 if ( $user->isAllowed( 'chat' ) && !$user->isBlocked() ) {
                ChatSendPMAPI.php  (1 usage found)
                    ChatSendPMAPI  (1 usage found)
                        execute  (1 usage found)
                            10 if ( $user->isAllowed( 'chat' ) && !$user->isBlocked() ) {
            extensions/MiniInvite/includes/specials  (1 usage found)
                SpecialInviteEmail.php  (1 usage found)
                    InviteEmail  (1 usage found)
                        execute  (1 usage found)
                            25 if ( $user->isBlocked() ) {
            extensions/MultiUpload  (1 usage found)
                SpecialMultiUpload.php  (1 usage found)
                    SpecialMultiUpload  (1 usage found)
                        execute  (1 usage found)
                            71 if ( $user->isBlocked() ) {
            extensions/Newsletter/includes  (1 usage found)
                NewsletterEditPage.php  (1 usage found)
                    NewsletterEditPage  (1 usage found)
                        edit  (1 usage found)
                            46 if ( $this->user->isBlocked() ) {
            extensions/Newsletter/includes/specials  (1 usage found)
                SpecialNewsletter.php  (1 usage found)
                    SpecialNewsletter  (1 usage found)
                        doAnnounceExecute  (1 usage found)
                            275 if ( $user->isBlocked() ) {
            extensions/NewUserActions/src/Actions  (1 usage found)
                CreateWikiPage.php  (1 usage found)
                    CreateWikiPage  (1 usage found)
                        editorCanEdit  (1 usage found)
                            98 return $this->editor && !$this->editor->isBlocked();
            extensions/NewUserMessage  (1 usage found)
                NewUserMessage.class.php  (1 usage found)
                    NewUserMessage  (1 usage found)
                        createNewUserMessage  (1 usage found)
                            173 if ( !$editor || $editor->isBlocked() ) {
            extensions/Nuke/includes  (1 usage found)
                SpecialNuke.php  (1 usage found)
                    SpecialNuke  (1 usage found)
                        execute  (1 usage found)
                            23 if ( $currentUser->isBlocked() ) {
            extensions/OAuth/api  (1 usage found)
                MWOAuthSessionProvider.php  (1 usage found)
                    MWOAuthSessionProvider  (1 usage found)
                        provideSessionInfo  (1 usage found)
                            120 ( $this->config->get( 'BlockDisablesLogin' ) && $localUser->isBlocked() )
            extensions/OAuth/backend  (1 usage found)
                MWOAuthServer.php  (1 usage found)
                    MWOAuthServer  (1 usage found)
                        authorize  (1 usage found)
                            303 if ( $mwUser->isLocked() || $wgBlockDisablesLogin && $mwUser->isBlocked() ) {
            extensions/OAuth/control  (1 usage found)
                MWOAuthConsumerSubmitControl.php  (1 usage found)
                    MWOAuthConsumerSubmitControl  (1 usage found)
                        checkBasePermissions  (1 usage found)
                            141 } elseif ( $user->isLocked() || $wgBlockDisablesLogin && $user->isBlocked() ) {
            extensions/OAuth/frontend/specialpages  (2 usages found)
                SpecialMWOAuth.php  (2 usages found)
                    SpecialMWOAuth  (2 usages found)
                        execute  (1 usage found)
                            189 $wgBlockDisablesLogin && $localUser->isBlocked()
                        outputJWT  (1 usage found)
                            314 $statement['blocked'] = $user->isBlocked();
            extensions/PageForms/specials  (1 usage found)
                PF_UploadWindow.php  (1 usage found)
                    PFUploadWindow  (1 usage found)
                        execute  (1 usage found)
                            132 if ( $this->getUser()->isBlocked() ) {
            extensions/Patroller  (3 usages found)
                SpecialPatroller.php  (3 usages found)
                    SpecialPatroller  (3 usages found)
                        execute  (2 usages found)
                            44 if ( $wgUser->isBlocked() ) {
                            59 if ( !$wgUser->isBlocked( false ) ) {
                        revert  (1 usage found)
                            342 if ( !$wgUser->isBlocked( false ) ) { // Check block against master
            extensions/Petition  (1 usage found)
                SpecialPetition.php  (1 usage found)
                    SpecialPetition  (1 usage found)
                        execute  (1 usage found)
                            34 if ( $user->isBlocked() ) {
            extensions/PictureGame/includes/specials  (3 usages found)
                SpecialPictureGameAjaxUpload.php  (1 usage found)
                    SpecialPictureGameAjaxUpload  (1 usage found)
                        execute  (1 usage found)
                            109 if ( $user->isBlocked() ) {
                SpecialPictureGameHome.php  (2 usages found)
                    PictureGameHome  (2 usages found)
                        execute  (2 usages found)
                            54 if ( $user->isBlocked() ) {
                            141 if ( $user->isBlocked() ) {
            extensions/Poll  (1 usage found)
                Poll_body.php  (1 usage found)
                    Poll  (1 usage found)
                        execute  (1 usage found)
                            34 if ( $userObject->isBlocked() && $action != 'list' ) {
            extensions/PollNY/includes/specials  (4 usages found)
                SpecialAdminPoll.php  (1 usage found)
                    AdminPoll  (1 usage found)
                        execute  (1 usage found)
                            46 if ( $user->isBlocked() ) {
                SpecialCreatePoll.php  (1 usage found)
                    CreatePoll  (1 usage found)
                        execute  (1 usage found)
                            39 if ( $user->isBlocked() ) {
                SpecialPollAjaxUpload.php  (1 usage found)
                    SpecialPollAjaxUpload  (1 usage found)
                        execute  (1 usage found)
                            108 if ( $user->isBlocked() ) {
                SpecialUpdatePoll.php  (1 usage found)
                    UpdatePoll  (1 usage found)
                        execute  (1 usage found)
                            32 if ( $user->isBlocked() ) {
            extensions/PrivateDomains  (1 usage found)
                SpecialPrivateDomains.php  (1 usage found)
                    PrivateDomains  (1 usage found)
                        mainForm  (1 usage found)
                            105 if ( $user->isBlocked() ) {
            extensions/ProtectSite  (1 usage found)
                ProtectSite.body.php  (1 usage found)
                    ProtectSite  (1 usage found)
                        execute  (1 usage found)
                            49 if ( $user->isBlocked() ) {
            extensions/Push/src/api  (1 usage found)
                ApiPushBase.php  (1 usage found)
                    ApiPushBase  (1 usage found)
                        execute  (1 usage found)
                            168 if ( !$wgUser->isAllowed( 'push' ) || $wgUser->isBlocked() ) {
            extensions/QuizGame/includes/api  (1 usage found)
                ApiQuizGameVote.php  (1 usage found)
                    ApiQuizGameVote  (1 usage found)
                        execute  (1 usage found)
                            151 if ( !$user->isBlocked() && is_numeric( $points ) ) {
            extensions/QuizGame/includes/specials  (4 usages found)
                SpecialQuestionGameUpload.php  (1 usage found)
                    SpecialQuestionGameUpload  (1 usage found)
                        execute  (1 usage found)
                            107 if ( $user->isBlocked() ) {
                SpecialQuizGameHome.php  (2 usages found)
                    QuizGameHome  (2 usages found)
                        execute  (1 usage found)
                            51 if ( $user->isBlocked() ) {
                        renderWelcomePage  (1 usage found)
                            1327 if ( $user->isBlocked() ) {
                SpecialQuizRecalcStats.php  (1 usage found)
                    QuizRecalcStats  (1 usage found)
                        execute  (1 usage found)
                            31 if ( $user->isBlocked() ) {
            extensions/ReassignEdits  (1 usage found)
                ReassignEdits_body.php  (1 usage found)
                    SpecialReassignEdits  (1 usage found)
                        execute  (1 usage found)
                            50 if ( $user->isBlocked() ) {
            extensions/RefreshSpecial  (1 usage found)
                RefreshSpecial.body.php  (1 usage found)
                    RefreshSpecial  (1 usage found)
                        execute  (1 usage found)
                            54 if ( $user->isBlocked() ) {
            extensions/Renameuser/includes  (1 usage found)
                SpecialRenameuser.php  (1 usage found)
                    SpecialRenameuser  (1 usage found)
                        execute  (1 usage found)
                            43 if ( $user->isBlocked() ) {
            extensions/RevisionCommentSupplement/special  (1 usage found)
                SpecialRevisionCommentSupplement.php  (1 usage found)
                    SpecialRevisionCommentSupplement  (1 usage found)
                        execute  (1 usage found)
                            49 if( $user->isBlocked() ){
            extensions/SecurePoll/includes/user  (1 usage found)
                Auth.php  (1 usage found)
                    SecurePoll_LocalAuth  (1 usage found)
                        getUserParams  (1 usage found)
                            228 'blocked' => $user->isBlocked(),
            extensions/SiteMetrics/includes/specials  (1 usage found)
                SpecialSiteMetrics.php  (1 usage found)
                    SiteMetrics  (1 usage found)
                        execute  (1 usage found)
                            181 if ( $user->isBlocked() ) {
            extensions/SocialProfile/SystemGifts/includes/specials  (4 usages found)
                SpecialPopulateAwards.php  (1 usage found)
                    PopulateAwards  (1 usage found)
                        execute  (1 usage found)
                            34 if ( $user->isBlocked() ) {
                SpecialRemoveMasterSystemGift.php  (1 usage found)
                    RemoveMasterSystemGift  (1 usage found)
                        execute  (1 usage found)
                            52 if ( $user->isBlocked() ) {
                SpecialSystemGiftManager.php  (1 usage found)
                    SystemGiftManager  (1 usage found)
                        execute  (1 usage found)
                            37 if ( $user->isBlocked() ) {
                SpecialSystemGiftManagerLogo.php  (1 usage found)
                    SystemGiftManagerLogo  (1 usage found)
                        execute  (1 usage found)
                            45 if ( $user->isBlocked() ) {
            extensions/SocialProfile/UserBoard/includes/api  (1 usage found)
                ApiSendUserBoardMessage.php  (1 usage found)
                    ApiSendUserBoardMessage  (1 usage found)
                        execute  (1 usage found)
                            18 if ( $user->isBlocked() || $readOnlyMode->isReadOnly() ) {
            extensions/SocialProfile/UserBoard/includes/specials  (3 usages found)
                SpecialSendBoardBlast.php  (1 usage found)
                    SpecialBoardBlast  (1 usage found)
                        execute  (1 usage found)
                            36 if ( $user->isBlocked() ) {
                SpecialUserBoard.php  (2 usages found)
                    SpecialViewUserBoard  (2 usages found)
                        execute  (2 usages found)
                            258 if ( $currentUser->isBlocked() ) {
                            267 if ( $currentUser->isLoggedIn() && !$currentUser->isBlocked() ) {
            extensions/SocialProfile/UserGifts/includes/specials  (7 usages found)
                SpecialGiftManager.php  (3 usages found)
                    GiftManager  (3 usages found)
                        canUserCreateGift  (1 usage found)
                            167 if ( $user->isBlocked() ) {
                        canUserDelete  (1 usage found)
                            141 if ( $user->isBlocked() ) {
                        execute  (1 usage found)
                            48 if ( $user->isBlocked() ) {
                SpecialGiftManagerLogo.php  (2 usages found)
                    GiftManagerLogo  (2 usages found)
                        executeLogo  (2 usages found)
                            135 if ( !$user->isAllowed( 'upload' ) || $user->isBlocked() ) {
                            142 if ( $user->isBlocked() ) {
                SpecialGiveGift.php  (1 usage found)
                    GiveGift  (1 usage found)
                        execute  (1 usage found)
                            81 } elseif ( $user->isBlocked() ) {
                SpecialRemoveMasterGift.php  (1 usage found)
                    RemoveMasterGift  (1 usage found)
                        execute  (1 usage found)
                            76 if ( $user->isBlocked() ) {
            extensions/SocialProfile/UserProfile/includes  (1 usage found)
                UserProfilePage.php  (1 usage found)
                    UserProfilePage  (1 usage found)
                        getUserBoard  (1 usage found)
                            1780 if ( $user->isLoggedIn() && !$user->isBlocked() ) {
            extensions/SocialProfile/UserProfile/includes/specials  (5 usages found)
                SpecialEditProfile.php  (1 usage found)
                    SpecialEditProfile  (1 usage found)
                        execute  (1 usage found)
                            39 if ( $user->isBlocked() ) {
                SpecialPopulateExistingUsersProfiles.php  (1 usage found)
                    SpecialPopulateUserProfiles  (1 usage found)
                        execute  (1 usage found)
                            40 if ( $user->isBlocked() ) {
                SpecialRemoveAvatar.php  (1 usage found)
                    RemoveAvatar  (1 usage found)
                        execute  (1 usage found)
                            75 if ( $user->isBlocked() ) {
                SpecialToggleUserPageType.php  (1 usage found)
                    SpecialToggleUserPage  (1 usage found)
                        execute  (1 usage found)
                            73 if ( $user_page_type == 1 && !$user->isBlocked() ) {
                SpecialUpdateProfile.php  (1 usage found)
                    SpecialUpdateProfile  (1 usage found)
                        execute  (1 usage found)
                            64 if ( $user->isBlocked() ) {
            extensions/SocialProfile/UserRelationship/includes/api  (1 usage found)
                ApiRelationshipResponse.php  (1 usage found)
                    ApiRelationshipResponse  (1 usage found)
                        execute  (1 usage found)
                            17 if ( $user->isBlocked() || $readOnlyMode->isReadOnly() ) {
            extensions/SocialProfile/UserRelationship/includes/specials  (1 usage found)
                SpecialAddRelationship.php  (1 usage found)
                    SpecialAddRelationship  (1 usage found)
                        execute  (1 usage found)
                            85 } elseif ( $currentUser->isBlocked() ) {
            extensions/SocialProfile/UserStats/includes  (2 usages found)
                RandomFeaturedUser.php  (1 usage found)
                    RandomFeaturedUser  (1 usage found)
                        getRandomUser  (1 usage found)
                            70 if ( !$user->isBlocked() ) {
                TopUsersListLookup.php  (1 usage found)
                    TopUsersListLookup  (1 usage found)
                        getListByTimePeriod  (1 usage found)
                            90 if ( !$user->isBlocked() && $exists && !$user->isBot() ) {
            extensions/SocialProfile/UserStats/includes/specials  (4 usages found)
                GenerateTopUsersReport.php  (1 usage found)
                    GenerateTopUsersReport  (1 usage found)
                        execute  (1 usage found)
                            47 if ( $user->isBlocked() ) {
                TopFansByStat.php  (1 usage found)
                    TopFansByStat  (1 usage found)
                        execute  (1 usage found)
                            109 if ( $exists && !$u->isBlocked() && !$u->isBot() ) {
                TopFansRecent.php  (1 usage found)
                    TopFansRecent  (1 usage found)
                        execute  (1 usage found)
                            109 if ( $exists && !$u->isBlocked() && !$u->isBot() ) {
                TopUsers.php  (1 usage found)
                    TopUsersPoints  (1 usage found)
                        execute  (1 usage found)
                            76 if ( $exists && !$user->isBlocked() && !$user->isBot() ) {
            extensions/SpamRegex/backend  (1 usage found)
                SpecialSpamRegex.php  (1 usage found)
                    SpecialSpamRegex  (1 usage found)
                        execute  (1 usage found)
                            45 if ( $user->isBlocked() ) {
            extensions/SportsTeams/includes/specials  (3 usages found)
                SpecialSportsManagerLogo.php  (1 usage found)
                    SportsManagerLogo  (1 usage found)
                        executeLogo  (1 usage found)
                            105 if ( !$user->isAllowed( 'upload' ) || $user->isBlocked() ) {
                SpecialSportsTeamsManager.php  (1 usage found)
                    SportsTeamsManager  (1 usage found)
                        execute  (1 usage found)
                            40 if ( $user->isBlocked() ) {
                SpecialSportsTeamsManagerLogo.php  (1 usage found)
                    SportsTeamsManagerLogo  (1 usage found)
                        executeLogo  (1 usage found)
                            104 if ( !$user->isAllowed( 'upload' ) || $user->isBlocked() ) {
            extensions/Sudo  (1 usage found)
                SpecialSudo.php  (1 usage found)
                    SpecialSudo  (1 usage found)
                        execute  (1 usage found)
                            68 if ( $user->isBlocked() ) {
            extensions/Survey/api  (7 usages found)
                ApiAddSurvey.php  (1 usage found)
                    ApiAddSurvey  (1 usage found)
                        execute  (1 usage found)
                            23 if ( !$wgUser->isAllowed( 'surveyadmin' ) || $wgUser->isBlocked() ) {
                ApiDeleteSurvey.php  (1 usage found)
                    ApiDeleteSurvey  (1 usage found)
                        execute  (1 usage found)
                            24 if ( !$wgUser->isAllowed( 'surveyadmin' ) || $wgUser->isBlocked() ) {
                ApiEditSurvey.php  (1 usage found)
                    ApiEditSurvey  (1 usage found)
                        execute  (1 usage found)
                            24 if ( !$wgUser->isAllowed( 'surveyadmin' ) || $wgUser->isBlocked() ) {
                ApiQuerySurveyAnswers.php  (1 usage found)
                    ApiQuerySurveyAnswers  (1 usage found)
                        execute  (1 usage found)
                            27 if ( !$wgUser->isAllowed( 'surveyadmin' ) || $wgUser->isBlocked() ) {
                ApiQuerySurveys.php  (1 usage found)
                    ApiQuerySurveys  (1 usage found)
                        execute  (1 usage found)
                            26 if ( !$user->isAllowed( 'surveysubmit' ) || $user->isBlocked() ) {
                ApiQuerySurveySubmissions.php  (1 usage found)
                    ApiQuerySurveySubmissions  (1 usage found)
                        execute  (1 usage found)
                            27 if ( !$wgUser->isAllowed( 'surveyadmin' ) || $wgUser->isBlocked() ) {
                ApiSubmitSurvey.php  (1 usage found)
                    ApiSubmitSurvey  (1 usage found)
                        execute  (1 usage found)
                            23 if ( !$user->isAllowed( 'surveysubmit' ) || $user->isBlocked() ) {
            extensions/Thanks/includes  (3 usages found)
                ApiThank.php  (1 usage found)
                    ApiThank  (1 usage found)
                        dieOnBadUser  (1 usage found)
                            15 } elseif ( $user->isBlocked() ) {
                ThanksHooks.php  (2 usages found)
                    ThanksHooks  (2 usages found)
                        insertThankLink  (1 usage found)
                            66 && !$user->isBlocked()
                        onLogEventsListLineEnding  (1 usage found)
                            375 if ( $wgUser->isAnon() || $wgUser->isBlocked() || $wgUser->isBlockedGlobally() ) {
            extensions/TinyMCE/upload  (1 usage found)
                TinyMCEUploadWindow.php  (1 usage found)
                    TinyMCEUploadWindow  (1 usage found)
                        execute  (1 usage found)
                            200 if ( $this->getUser()->isBlocked() ) {
            extensions/Translate/api  (2 usages found)
                ApiGroupReview.php  (1 usage found)
                    ApiGroupReview  (1 usage found)
                        execute  (1 usage found)
                            34 if ( $user->isBlocked() ) {
                ApiTranslationReview.php  (1 usage found)
                    ApiTranslationReview  (1 usage found)
                        getReviewBlockers  (1 usage found)
                            118 if ( $user->isBlocked() ) {
            extensions/UploadWizard/includes/specials  (1 usage found)
                SpecialUploadWizard.php  (1 usage found)
                    SpecialUploadWizard  (1 usage found)
                        isUserUploadAllowed  (1 usage found)
                            287 if ( $user->isBlocked() ) {
            extensions/UserFunctions  (1 usage found)
                UserFunctions_body.php  (1 usage found)
                    ExtUserFunctions  (1 usage found)
                        ifblockedObj  (1 usage found)
                            64 if( $pUser->isBlocked() ){
            extensions/UserStatus/includes  (1 usage found)
                UserStatus.class.php  (1 usage found)
                    UserStatus  (1 usage found)
                        addStatus  (1 usage found)
                            32 if ( $wgUser->isBlocked() ) {
            extensions/UserStatus/includes/api  (1 usage found)
                ApiUserStatus.php  (1 usage found)
                    ApiUserStatus  (1 usage found)
                        execute  (1 usage found)
                            24 if ( $user->isBlocked() || wfReadOnly() ) {
            extensions/UserStatus/includes/specials  (1 usage found)
                SpecialFanUpdates.php  (1 usage found)
                    ViewFanUpdates  (1 usage found)
                        execute  (1 usage found)
                            160 if ( $user->isLoggedIn() && !$user->isBlocked() && !wfReadOnly() ) {
            extensions/Video/includes/specials  (1 usage found)
                SpecialUndeleteWithVideoSupport.php  (1 usage found)
                    SpecialUndeleteWithVideoSupport  (1 usage found)
                        loadRequest  (1 usage found)
                            61 if ( $this->isAllowed( 'undelete' ) && !$user->isBlocked() ) {
            extensions/WebDAV/includes  (1 usage found)
                WebDAVFileFile.php  (1 usage found)
                    WebDAVFileFile  (1 usage found)
                        publishToWiki  (1 usage found)
                            183 if ( $user->isBlocked() ) {
            extensions/Wikibase/repo/includes/Specials  (1 usage found)
                SpecialWikibasePage.php  (1 usage found)
                    SpecialWikibasePage  (1 usage found)
                        checkBlocked  (1 usage found)
                            87 if ( $this->getUser()->isBlocked() ) {
            extensions/Wikibase/repo/tests/phpunit/includes/Api  (1 usage found)
                ApiUserBlockedTest.php  (1 usage found)
                    ApiUserBlockedTest  (1 usage found)
                        testBlock  (1 usage found)
                            224 $this->assertTrue( $testuser->isBlocked(), 'User is expected to be blocked' );
            extensions/WikibaseLexeme/src/MediaWiki/Specials  (1 usage found)
                SpecialNewLexeme.php  (1 usage found)
                    SpecialNewLexeme  (1 usage found)
                        checkBlocked  (1 usage found)
                            119 if ( $this->getUser()->isBlocked() ) {
            extensions/WikibaseLexeme/tests/phpunit/mediawiki/Api  (1 usage found)
                ApiUserBlockedTest.php  (1 usage found)
                    ApiUserBlockedTest  (1 usage found)
                        testAddForm  (1 usage found)
                            142 $this->assertTrue( $testuser->isBlocked(), 'User is expected to be blocked' );
            extensions/WikiForum/includes/specials  (1 usage found)
                SpecialWikiForum.php  (1 usage found)
                    SpecialWikiForum  (1 usage found)
                        execute  (1 usage found)
                            32 if ( $user->isBlocked() ) {
            extensions/WikiLexicalData/includes/api  (4 usages found)
                owAddAnnotation.php  (1 usage found)
                    AddAnnotation  (1 usage found)
                        execute  (1 usage found)
                            29 if ( $this->getUser()->isBlocked() ) {
                owAddDefinition.php  (1 usage found)
                    AddDefinition  (1 usage found)
                        execute  (1 usage found)
                            24 if ( $wgUser->isBlocked() ) {
                owAddSyntrans.php  (1 usage found)
                    AddSyntrans  (1 usage found)
                        execute  (1 usage found)
                            43 if ( $wgUser->isBlocked() ) {
                owAddToCollection.php  (1 usage found)
                    AddToCollection  (1 usage found)
                        execute  (1 usage found)
                            28 if ( $this->getUser()->isBlocked() ) {
            extensions/WikiLexicalData/includes/specials  (1 usage found)
                SpecialOWAddFromExternalAPI.php  (1 usage found)
                    SpecialOWAddFromExternalAPI  (1 usage found)
                        process  (1 usage found)
                            108 if ( $this->getUser()->isBlocked() ) {
            skins/Nimbus/includes  (1 usage found)
                NimbusTemplate.php  (1 usage found)
                    NimbusTemplate  (1 usage found)
                        footer  (1 usage found)
                            789 if ( !$user->isBlocked() ) {

By the policy, we have to do the soft deprecation first, so I'd start with that.

We do have the option of doing it at the same time:
"Often code is soft deprecated first, and hard deprecated at a later date, but they MAY occur at the same time."

Then, I'd start a list of files and line numbers (which could obviously change) here in this ticket. We can then decide how much of that we can tackle.

Thanks @Reedy !

It does feel like we will have some wiggle room in the near future with regards to effort we can put toward this.

I think these points:

"Developers SHOULD update MediaWiki core to no longer use the deprecated functionality."
and
"Developers SHOULD update any extension or skin bundled with the MediaWiki tarball when soft deprecating, and MAY update popular extensions"

are what we should consider. How much of that (anywhere from none to all) do we want to do as part of this ticket?

Maybe we could timebox it? Give it 4 days? I don't know the number.

Whatever we decide, we should validate with the rest of the team that it's workable and reasonable.

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

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

So, uh, deprecated into what, exactly? What's the path forward for making this transition for other extension developers? Have you discussed the specific usages with anyone outside the team to ensure you're not going to be breaking anything currently in play, or that we may later need in core/wikimedia-side?

If the rest of us are supposed to act on this, we need a lot more information, here. A more descriptive task description would probably help a lot as a start. (In particular, what's confusing, what are the replacements, and how will this confusion impact those, if it's apt to be such an issue?)

@Isarra I updated the task description with the commit message from https://gerrit.wikimedia.org/r/c/494497/ is that helpful?

Thanks, that definitely helps for context.

So now we should be doing two things - checking if user can do thing in general, and if use can do thing in specific place?

So now we should be doing two things - checking if user can do thing in general, and if use can do thing in specific place?

Right so it depends on your use case. There are some cases where just doing User::getBlock() is fine, but note that if you were to do that, you'd also prevent people from performing an action, even if they are blocked from only a single page (which, most of the time, is not what you want). To restore the original behavior, doing something like $user->getBlock() && $user->getBlock()->isSitewide() is probably more what you want (i.e. I want to block this person, only if they have a sitewide block, rather than a partial block).

But again, if your code deals with a Title then it would be best to use the existing access checks for that.

I looked at https://codesearch.wmflabs.org/deployed/?q=isBlocked%5C(%5C)&i=nope&files=&repos=, which contains a subset of what @Reedy mentions.

core
Autopromote
"APCOND_BLOCKED" condition applies even if user is partial blocked, although according to noc we don't use block status for any autopromotes on our own wikis.

We could also change the doc to warn people https://www.mediawiki.org/wiki/Manual:$wgAutopromote.

DeleteRevision
Already raised as T208509.

Tags
Raised as T221444.

ImportImages
https://www.mediawiki.org/wiki/Manual:ImportImages.php
Requires access to the server the wiki is on. Niche?

Extensions
Of the ones that are "Wikimedia deployed" according to https://codesearch.wmflabs.org/deployed.

Many potentially over-block users by treating sitewide and partial blocks the same:

  • ContentTranslation (https://phabricator.wikimedia.org/T209964)
  • Newsletter
  • Thanks (we already know)
  • Translate
  • Wikibase
  • WikibaseLexeme
  • Babel
  • CodeReview
  • FileImporter
  • GWToolset
  • NewUserMessage
  • Nuke
  • Petition
  • Renameuser
  • UrlShortener
  • FlaggedRev (autopromote)
  • CheckUser (cannot do doMassUserBlock())

Those I think are OK
ApiBlock, ApiUnblock and SpecialBlock
Code prevents an admin with any kind of block from unblocking themselves unless they have "unblockself" right (or they were the one who blocked themselves in the first place). This seems reasonable.

SpecialContributions
includes/specials/SpecialContributions.php has an appropriate (I assume) use of:

( $target->isBlocked() && $target->getBlock()->getType() != Block::TYPE_AUTO )

SpecialUserrights and ApiUserrights
Sitewide or partially blocked user not allowed to change user rights, unless they have "userrights" permission. Seems reasonable.

Other
Things which may be dealt with as part of T208895:

  • includes/auth/CheckBlocksSecondaryAuthenticationProvider.php
  • includes/mail/EmailNotification.php
  • Extension:Echo
  • Several places in Extension:OAuth

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

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

Change 505848 merged by jenkins-bot:
[mediawiki/core@master] Deprecate User::isBlocked()

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

All the code changes appear to be replacing "$user->isBlocked()" with "$user->getBlock()", which should behave the same.

We already know that for some actions a partially blocked user will be blocked inappropriately. Some of these have their own tickets. Others may need to be raised.