jenkins-bot has submitted this change and it was merged.

Change subject: Add wgIsProbablyEditable for editability based on quickUserCan.
......................................................................


Add wgIsProbablyEditable for editability based on quickUserCan.

It uses quickUserCan like SkinTemplate, for performance reasons.

Bug: 43790
Change-Id: I2f77b69624cc1a4cd74c8178eea53681f3f2b107
---
M includes/OutputPage.php
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 96a503e..96c7830 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -3051,6 +3051,8 @@
                if ( $wgContLang->hasVariants() ) {
                        $vars['wgUserVariant'] = 
$wgContLang->getPreferredVariant();
                }
+               // Same test as SkinTemplate
+               $vars['wgIsProbablyEditable'] = $title->quickUserCan( 'edit', 
$user ) && ( $title->exists() || $title->quickUserCan( 'create', $user ) );
                foreach ( $title->getRestrictionTypes() as $type ) {
                        $vars['wgRestriction' . ucfirst( $type )] = 
$title->getRestrictions( $type );
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/65009
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f77b69624cc1a4cd74c8178eea53681f3f2b107
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Platonides <platoni...@gmail.com>
Gerrit-Reviewer: Spage <sp...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to