From ffed8cbe310ce0478c65443ed4e73557dca46d4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= Date: Sun, 19 Jun 2011 18:07:13 +0000 Subject: [PATCH] (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' --- RELEASE-NOTES-1.19 | 2 ++ includes/Preferences.php | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) 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', -- 2.20.1