User "Bryan" posted a comment on MediaWiki.r92364.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/92364#c19712
Commit summary:

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().

Comment:

If it doesn't make sense to sense a right per-namespace, then don't set a it 
per-namespace. But even if you do, this code will handle it gracefully.

For per namespace read rights the usual disclaimers apply.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to