From: Aryeh Gregor Date: Sun, 27 Jan 2008 17:31:47 +0000 (+0000) Subject: Don't display rollback link if the user doesn't have all required permissions X-Git-Tag: 1.31.0-rc.0~49758 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=b37c6bec93248f6eb19e7b7c95a665e48f00ecd5;p=lhc%2Fweb%2Fwiklou.git Don't display rollback link if the user doesn't have all required permissions --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e1ef5875d7..c2cc5408dc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -341,7 +341,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 12790) Page protection is not logged when edit-protection is used and move-protection is not * (bug 12793) Fix for restricted namespaces/pages in Special:Export * Fix for Special:Export so it doesn't ignore the page named '0' - +* Don't display rollback link if the user doesn't have all required permissions == Parser changes in 1.12 == diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 3c8c8a1270..4202debf2e 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -262,7 +262,9 @@ class PageHistory { $tools = array(); if ( !is_null( $next ) && is_object( $next ) ) { - if( $wgUser->isAllowed( 'rollback' ) && $latest ) { + if( !$this->mTitle->getUserPermissionsErrors( 'rollback', $wgUser ) + && !$this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ) + && $latest ) { $tools[] = '' . $this->mSkin->buildRollbackLink( $rev ) . ''; diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 333898b842..94e381f6d1 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -114,9 +114,9 @@ class ContribsPager extends ReverseChronologicalPager { * Generates each row in the contributions list. * * Contributions which are marked "top" are currently on top of the history. - * For these contributions, a [rollback] link is shown for users with sysop - * privileges. The rollback link restores the most recent version that was not - * written by the target user. + * For these contributions, a [rollback] link is shown for users with roll- + * back privileges. The rollback link restores the most recent version that + * was not written by the target user. * * @todo This would probably look a lot nicer in a table. */ @@ -139,7 +139,8 @@ class ContribsPager extends ReverseChronologicalPager { $difftext .= $this->messages['newarticle']; } - if( $wgUser->isAllowed( 'rollback' ) ) { + if( !$page->getUserPermissionsErrors( 'rollback', $wgUser ) + && !$page->getUserPermissionsErrors( 'edit', $wgUser ) ) { $topmarktext .= ' '.$sk->generateRollback( $rev ); }