First steps for bug 14801: add backend support for per-namespace permissions to core...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 16 Jul 2011 16:09:00 +0000 (16:09 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 16 Jul 2011 16:09:00 +0000 (16:09 +0000)
commit1fb5d73612b8137641bf3229c9a873323193cf97
tree9dff54c11d1482e5dbdfa3ee0134291cc05c1acd
parent572328180cb42f4fafb9b0400bcec58ee151721a
First steps for bug 14801: add backend support for per-namespace permissions to core. This extends $wgGroupPermissions syntax from $wgGroupPermissions[$group][$right] = bool to $wgGroupPermissions[$group][$right] = array( NS_X => bool ). This is safely backwards compatible; the booleans are still fully supported, and any unset namespace will default to false.

* User::getRights(), User::isAllowed() and User::getGroupPermissions now optionally accept a namespace parameter. If not set, it will check whether the user has the right for all namespaces.
* Anything that uses Title::getUserPermissionsErrorsInternal() automatically supports per-namespace permissions. This includes Title::getUserPermissionsErrors and Title::(quick)UserCan.
* Fix tests that set User::mRights

The next step would be to change all User::isAllowed() to Title::quickUserCan or pass the namespace to User::isAllowed().
RELEASE-NOTES-1.19
includes/DefaultSettings.php
includes/Title.php
includes/User.php
tests/phpunit/includes/ArticleTablesTest.php
tests/phpunit/includes/TitlePermissionTest.php
tests/phpunit/includes/UserTest.php