Page MenuHomePhabricator

Move isNamespaceProtected() and getRestrictionLevels() methods into PermissionManager.
Open, MediumPublic

Description

Currently, Title::isNamespaceProtected() checks the $wgNamespaceProtection to test whether the namespace is protected; And MWNamespace::getRestrictionLevels() uses $wgNamespaceProtection to determined the available restriction levels. Based on the usage of these methods it seems that they should both live in PermissionManager instead.

Details

Reference
bz9977
Related Gerrit Patches:

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:39 PM
bzimport added a project: MediaWiki-General.
bzimport set Reference to bz9977.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.May 20 2007, 1:09 PM

sacolcor wrote:

Fix for typo in first patch

attachment patchNamespaceUserCan.diff ignored as obsolete

sacolcor wrote:

Updated patch

Attached:

sumanah wrote:

Thank you for your patch, and my apologies it's taken so very, very long for us to respond to you.

I tried applying the patch, and -- since the trunk has changed so much since you submitted it -- it doesn't apply cleanly anymore.

$ patch < ~/test/wikimedia-dev/9977.txt
patching file hooks.txt
Hunk #1 FAILED at 561.
1 out of 1 hunk FAILED -- saving rejects to file hooks.txt.rej
patching file Title.php
Hunk #1 FAILED at 998.
Hunk #2 FAILED at 1007.
2 out of 2 hunks FAILED -- saving rejects to file Title.php.rej
patching file Namespace.php
Hunk #1 FAILED at 43.
1 out of 1 hunk FAILED -- saving rejects to file Namespace.php.rej
patching file RELEASE-NOTES
Hunk #1 FAILED at 22.
1 out of 1 hunk FAILED -- saving rejects to file RELEASE-NOTES.rej

Could you install the new MediaWiki 1.18 beta per http://lists.wikimedia.org/pipermail/mediawiki-announce/2011-November/000102.html and then see whether and how you'd like to make this change? Thanks!

sacolcor wrote:

Probably not soon, I'm afraid. Mediawiki took so long to review my patches that I ended up making a private fork of the code after 1.10, and I'm not sure when/if I'll try to re-sync.

(In reply to comment #3)

Could you install the new MediaWiki 1.18 beta per
http://lists.wikimedia.org/pipermail/mediawiki-announce/2011-November/000102.html
and then see whether and how you'd like to make this change? Thanks!

PLEASE PLEASE PLEASE do not base your patches off 1.18beta or any other release version. Patches submitted to Bugzilla should be against trunk and against trunk only. Sumana, please don't give people the wrong ideas ;)

sumanah wrote:

Roan, I shall be clearer in the future. I figure it's fine to suggest that people install the latest release or beta just to see whether the bug they are fixing is reproducible. Of course, once someone wants to write a patch, they have to base it on trunk, and I'll be extra-clear about that. Is that reasonable?

(In reply to comment #6)

Roan, I shall be clearer in the future. I figure it's fine to suggest that
people install the latest release or beta just to see whether the bug they are
fixing is reproducible. Of course, once someone wants to write a patch, they
have to base it on trunk, and I'll be extra-clear about that. Is that
reasonable?

Yes, that's entirely reasonable. The wording in comment #3 was unclear and didn't give me the impression you knew patches should be against trunk. I'm glad to see you do :)

Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 23 2016, 12:07 AM
Krinkle added subscribers: Simetrical, daniel, Krinkle.

@Simetrical @daniel This seems related to recent work on T208768. Is this still resolved? If not, does it still makes sense and what is left to do?

daniel renamed this task from Refactor namespace rights checks out of Title.php, into Namespace.php to Move isNamespaceProtected() and getRestrictionLevels() methods into PermissionManager..May 28 2019, 12:30 PM
daniel updated the task description. (Show Details)

@Simetrical @daniel This seems related to recent work on T208768. Is this still resolved? If not, does it still makes sense and what is left to do?

Thanks for poking us. This task is not done and still makes sense. I changed the description to reflect current reality.

D3r1ck01 updated the task description. (Show Details)Jul 18 2019, 11:05 AM

Change 531564 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Move getRestrictionLevels from NamespaceInfo to PermissionManager.

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

Change 531564 merged by jenkins-bot:
[mediawiki/core@master] Move getRestrictionLevels from NamespaceInfo to PermissionManager.

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

Change 531940 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Move Title::isNamespaceProtected() to PermissionManager.

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

Change 532496 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/VisualEditor@master] Remove usages of deprecated MWNamespace.

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

Change 532497 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/MassMessage@master] Remove usages of deprecated MWNamespace.

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

Change 532497 merged by jenkins-bot:
[mediawiki/extensions/MassMessage@master] Remove usages of deprecated MWNamespace

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

Change 532496 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Remove usages of deprecated MWNamespace.

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

Change 531940 merged by jenkins-bot:
[mediawiki/core@master] Move Title::isNamespaceProtected() to PermissionManager.

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