(bug 29342) Patrol preferences shouldn't be visible to users who don't have patrol...
authorMatěj Grabovský <mgrabovsky@users.mediawiki.org>
Sun, 19 Jun 2011 18:07:13 +0000 (18:07 +0000)
committerMatěj Grabovský <mgrabovsky@users.mediawiki.org>
Sun, 19 Jun 2011 18:07:13 +0000 (18:07 +0000)
Also show 'minordefault' only to those who can 'minoredit'

RELEASE-NOTES-1.19
includes/Preferences.php

index 7e640d7..935f5fe 100644 (file)
@@ -105,6 +105,8 @@ production.
   consecutive edits by same user in included diff, but then linked to
   a single ungrouped diff.
 * Do not try to group together a page creation and edit in the RSS feed of RC.
+* (bug 29342) Patrol preferences shouldn't be visible to users who don't have
+  patrol permissions
 
 === API changes in 1.19 ===
 * BREAKING CHANGE: action=watch now requires POST and token.
index a2995ab..8e30508 100644 (file)
@@ -745,11 +745,14 @@ class Preferences {
                        'section' => 'editing/advancedediting',
                        'label-message' => 'tog-showtoolbar',
                );
-               $defaultPreferences['minordefault'] = array(
-                       'type' => 'toggle',
-                       'section' => 'editing/advancedediting',
-                       'label-message' => 'tog-minordefault',
-               );
+
+               if ( $user->isAllowed( 'minoredit' ) ) {
+                       $defaultPreferences['minordefault'] = array(
+                               'type' => 'toggle',
+                               'section' => 'editing/advancedediting',
+                               'label-message' => 'tog-minordefault',
+                       );
+               }
 
                if ( $wgUseExternalEditor ) {
                        $defaultPreferences['externaleditor'] = array(
@@ -815,7 +818,7 @@ class Preferences {
                        'section' => 'rc/advancedrc',
                );
 
-               if ( $wgUseRCPatrol ) {
+               if ( $wgUseRCPatrol && $user->isAllowed( 'patrol' ) ) {
                        $defaultPreferences['hidepatrolled'] = array(
                                'type' => 'toggle',
                                'section' => 'rc/advancedrc',