Page MenuHomePhabricator

GlobalBlock::appliesToRight should return true for 'upload'
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

APIUpload and SpecialUpload check for global blocks separately from other blocks. If a global block is found, it blocks upload.

This is an example of MediaWiki core being aware of an extension.

Instead, the GlobalBlock itself should define that it blocks upload.

Acceptance Criteria
  • Calling GlobalBlock::appliesToRight( 'upload' ) returns true. For other rights, there are no changes in the return value.

Event Timeline

It should also return true for createaccount, I think. Or maybe it should do that depending on the value of the anonOnly flag? Not sure what's the expected behavior for anon-only global blocks (or the current behavior, for that matter).

It should also return true for createaccount, I think. Or maybe it should do that depending on the value of the anonOnly flag? Not sure what's the expected behavior for anon-only global blocks (or the current behavior, for that matter).

Currently, all global blocks block account creation. (T17273: Add "Prevent account creation" checkbox to allow global blocks which do not prevent account creation)

Change 835200 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GlobalBlocking@master] GlobalBlock::appliesToRight returns true for 'upload'

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

Change 835200 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] GlobalBlock::appliesToRight returns true for 'upload'

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

It should also return true for createaccount, I think. Or maybe it should do that depending on the value of the anonOnly flag? Not sure what's the expected behavior for anon-only global blocks (or the current behavior, for that matter).

Currently, all global blocks block account creation. (T17273: Add "Prevent account creation" checkbox to allow global blocks which do not prevent account creation)

Since global blocks all block create account then I think appliesToRight this should return true for createaccount, to make that explicit. I've written this up in T318827: GlobalBlock::isCreateAccountBlocked should return true.

This needn't stand in the way of T17273: Add "Prevent account creation" checkbox to allow global blocks which do not prevent account creation; we'd just need to make sure GlobalBlock::isCreateAccountBlocked returns the correct value for createaccount once that work is done.