X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FTemplatesOnThisPageFormatter.php;h=215e4ec8136bc53c92effaf963148779318f7dc4;hb=f97d13a10c1b7dac7c4463c3ccc75e21a731c7a2;hp=bca1ef651a69bc602a05c423a1d6db8c894a5fee;hpb=cbbb197f10511e49bc442af5e5487e6a443fed17;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/TemplatesOnThisPageFormatter.php b/includes/TemplatesOnThisPageFormatter.php index bca1ef651a..215e4ec813 100644 --- a/includes/TemplatesOnThisPageFormatter.php +++ b/includes/TemplatesOnThisPageFormatter.php @@ -20,6 +20,7 @@ use MediaWiki\Linker\LinkRenderer; use MediaWiki\Linker\LinkTarget; +use MediaWiki\MediaWikiServices; /** * Handles formatting for the "templates used on this page" @@ -158,11 +159,13 @@ class TemplatesOnThisPageFormatter { * Return a link to the edit page, with the text * saying "view source" if the user can't edit the page * - * @param Title $titleObj + * @param LinkTarget $titleObj * @return string */ - private function buildEditLink( Title $titleObj ) { - if ( $titleObj->quickUserCan( 'edit', $this->context->getUser() ) ) { + private function buildEditLink( LinkTarget $titleObj ) { + if ( MediaWikiServices::getInstance()->getPermissionManager() + ->quickUserCan( 'edit', $this->context->getUser(), $titleObj ) + ) { $linkMsg = 'editlink'; } else { $linkMsg = 'viewsourcelink';