From: Matěj Grabovský Date: Sun, 19 Jun 2011 18:07:13 +0000 (+0000) Subject: (bug 29342) Patrol preferences shouldn't be visible to users who don't have patrol... X-Git-Tag: 1.31.0-rc.0~29417 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=ffed8cbe310ce0478c65443ed4e73557dca46d4a;p=lhc%2Fweb%2Fwiklou.git (bug 29342) Patrol preferences shouldn't be visible to users who don't have patrol permissions Also show 'minordefault' only to those who can 'minoredit' --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 7e640d7e90..935f5fe5f3 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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. diff --git a/includes/Preferences.php b/includes/Preferences.php index a2995ab4f5..8e305083ef 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -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',