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

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/92364#c19711
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:

What about rights like 'read'? That wouldn't be enforced this way. What about 
rights that don't make sense per namespace - such as createaccount, or block? 
This seems like a poor idea.

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

Reply via email to