Index: trunk/phase3/includes/User.php |
— | — | @@ -1770,9 +1770,16 @@ |
1771 | 1771 | * @return boolean True: action is allowed, False: action should not be allowed |
1772 | 1772 | */ |
1773 | 1773 | function isAllowed($action='') { |
1774 | | - if ( $action === '' ) |
| 1774 | + global $wgGroupPermissions; |
| 1775 | + if( $action === '' ) { |
1775 | 1776 | // In the spirit of DWIM |
1776 | 1777 | return true; |
| 1778 | + } |
| 1779 | + if( !empty( $wgGroupPermissions['*'][$action] ) ) { |
| 1780 | + # Permissions are additive, so there's no need to unstub the User |
| 1781 | + # object in this case. |
| 1782 | + return true; |
| 1783 | + } |
1777 | 1784 | |
1778 | 1785 | return in_array( $action, $this->getRights() ); |
1779 | 1786 | } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1387,7 +1387,7 @@ |
1388 | 1388 | * @todo fold these checks into userCan() |
1389 | 1389 | */ |
1390 | 1390 | public function userCanRead() { |
1391 | | - global $wgUser, $wgGroupPermissions; |
| 1391 | + global $wgUser; |
1392 | 1392 | |
1393 | 1393 | $result = null; |
1394 | 1394 | wfRunHooks( 'userCan', array( &$this, &$wgUser, 'read', &$result ) ); |
— | — | @@ -1395,10 +1395,6 @@ |
1396 | 1396 | return $result; |
1397 | 1397 | } |
1398 | 1398 | |
1399 | | - # Shortcut for public wikis, allows skipping quite a bit of code |
1400 | | - if ($wgGroupPermissions['*']['read']) |
1401 | | - return true; |
1402 | | - |
1403 | 1399 | if( $wgUser->isAllowed( 'read' ) ) { |
1404 | 1400 | return true; |
1405 | 1401 | } else { |
Index: trunk/phase3/includes/Namespace.php |
— | — | @@ -165,4 +165,4 @@ |
166 | 166 | return $index >= NS_MAIN; |
167 | 167 | } |
168 | 168 | |
169 | | -} |
\ No newline at end of file |
| 169 | +} |