Commit graph

9 commits

Author SHA1 Message Date
Sam Reed
ec4604de3d Documentation and whitespace
Clearing another w/c
2012-01-19 14:56:18 +00:00
Tim Starling
3da36a9103 Reverted r92364 (per-namespace permissions).
This is the wrong configuration format for such a feature, and the wrong interface. We already have certain per-namespace permissions in the Title class, and we didn't need to add extra formal parameters to a whole lot of User methods in order to get them. The feature should be implemented wholly in Title, and the concept of user rights should remain relatively simple and easy to understand, and independent of its many applications, i.e. a user either has a right or doesn't. Rights are just a tool for developing access policies; the complexity should be in the caller.

The revert was mostly done by hand, since there were a lot of conflicts. I tried to preserve the gist of conflicting changes in r102187 and r102873. The test changes are not simple reverts, rather I just edited out the per-namespace tests. I reverted the followups r92589 and r104310.
2011-12-12 06:03:01 +00:00
Santhosh Thottingal
462319d089 Use dataProvider for the testIsValidUserName method. Followup r99466 2011-10-11 10:25:58 +00:00
Santhosh Thottingal
08aac7bd40 Stylize.php changes 2011-10-11 10:02:50 +00:00
Santhosh Thottingal
2a7c8be024 Testcases for isValidUserName method of User.php.
There are many cases this method will fail for non-latin languages, 
but not added now since there are bugs reported on that already and results
a rewrite of the method as per UAX 31 standard.
2011-10-11 09:17:36 +00:00
Platonides
2d9bb42682 Since r92364 UserTest.php needs a database 2011-07-19 21:41:25 +00:00
Bryan Tong Minh
1fb5d73612 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().
2011-07-16 16:09:00 +00:00
Bryan Tong Minh
6a16bea0d2 Follow-up r91895: Call parent destructor as well, just to be safe. 2011-07-11 18:38:26 +00:00
Bryan Tong Minh
8d89af55cc Add unit tests for $wgGroupPermissions/$wgRevokePermissions 2011-07-11 18:36:29 +00:00