SECURITY: Add permission check for user is permitted to view the log type
[lhc/web/wiklou.git] / includes / changetags / ChangeTagsLogItem.php
index 2dc953c..1b9fd92 100644 (file)
@@ -19,6 +19,8 @@
  * @ingroup Change tagging
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Item class for a logging table row with its associated change tags.
  * @todo Abstract out a base class for this and RevDelLogItem, similar to the
@@ -42,8 +44,12 @@ class ChangeTagsLogItem extends RevisionItemBase {
                return 'log_user_text';
        }
 
+       public function getAuthorActorField() {
+               return 'log_actor';
+       }
+
        public function canView() {
-               return LogEventsList::userCan( $this->row, Revision::DELETED_RESTRICTED, $this->list->getUser() );
+               return LogEventsList::userCan( $this->row, Revision::SUPPRESSED_ALL, $this->list->getUser() );
        }
 
        public function canViewContent() {
@@ -70,9 +76,9 @@ class ChangeTagsLogItem extends RevisionItemBase {
                $formatter->setAudience( LogFormatter::FOR_THIS_USER );
 
                // Log link for this page
-               $loglink = Linker::link(
+               $loglink = MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
                        SpecialPage::getTitleFor( 'Log' ),
-                       $this->list->msg( 'log' )->escaped(),
+                       $this->list->msg( 'log' )->text(),
                        [],
                        [ 'page' => $title->getPrefixedText() ]
                );