Add User::isEveryoneAllowed function
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 12 Jul 2013 15:06:41 +0000 (11:06 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 12 Jul 2013 15:18:15 +0000 (11:18 -0400)
commit76623e75dac07e1def6ae085958a7893a25badad
treece96916c9af0df30ce9b6dcd7fc68840af44b2ab
parentdf7ad7b5172b2af01457cbfaab5f83fc8768143c
Add User::isEveryoneAllowed function

User::groupHasPermission is used for various purposes, from checking
whether it makes sense to show a "hide logged-in users" on
Special:NewPages to showing different error messages in some places when
'user' or 'autoconfirmed' is allowed the action to avoiding unstubbing
$wgUser to check $wgUser->isAllowed( 'read' ) in the common case where
'read' permission is granted to everyone.

For the OAuth work, we need to be able to catch that last type of use
without interfering with the others. This change introduces
User::isEveryoneAllowed() to be used for that type of check, which both
makes sure the right granted to '*' isn't revoked from any group and
calls a hook to allow extensions to indicate that they might remove the
right.

Change-Id: Idfee1b4d0613aaf52e143164acd6022459415c49
RELEASE-NOTES-1.22
docs/hooks.txt
includes/AjaxDispatcher.php
includes/SpecialPage.php
includes/Title.php
includes/User.php
includes/api/ApiMain.php