Remove patrol config check in User::isAllowed()
authorcenarium <cenarium.sysop@gmail.com>
Tue, 12 Jan 2016 00:34:19 +0000 (01:34 +0100)
committercenarium <cenarium.sysop@gmail.com>
Tue, 12 Jan 2016 00:34:19 +0000 (01:34 +0100)
The isAllowed() function of the User class checks $wgUseRCPatrol and
$wgUseNPPatrol in case the action is 'patrol' or 'autopatrol'.
Considering we have the useRCPatrol and such functions, it shouldn't.
getUserPermissionsErrors of the Title class doesn't and extensions may
use patrol regardless of core config. If we don't remove it, we would
have to also check the new $wgUseFilePatrol.

Change-Id: I671a6b3aa3bd1dc274f2f8e61fb739235ced198c

includes/user/User.php

index b406bac..fc34fcc 100644 (file)
@@ -3276,13 +3276,6 @@ class User implements IDBAccessObject {
                if ( $action === '' ) {
                        return true; // In the spirit of DWIM
                }
-               // Patrolling may not be enabled
-               if ( $action === 'patrol' || $action === 'autopatrol' ) {
-                       global $wgUseRCPatrol, $wgUseNPPatrol;
-                       if ( !$wgUseRCPatrol && !$wgUseNPPatrol ) {
-                               return false;
-                       }
-               }
                // Use strict parameter to avoid matching numeric 0 accidentally inserted
                // by misconfiguration: 0 == 'foo'
                return in_array( $action, $this->getRights(), true );