SECURITY: Add permission check for user is permitted to view the log type
authorrxy <wikitech.rxy@rxy.jp>
Sun, 28 Apr 2019 20:04:01 +0000 (05:04 +0900)
committerReedy <reedy@wikimedia.org>
Thu, 6 Jun 2019 19:06:01 +0000 (19:06 +0000)
Bug: T222036
Change-Id: I7584ee8db23a8834bbab21e355cab9857a293f72

includes/changetags/ChangeTagsLogItem.php
includes/specials/SpecialEditTags.php

index 75b713e..2bac909 100644 (file)
@@ -49,7 +49,7 @@ class ChangeTagsLogItem extends RevisionItemBase {
        }
 
        public function canView() {
        }
 
        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() {
        }
 
        public function canViewContent() {
index ed398de..6ef6cb3 100644 (file)
@@ -227,6 +227,9 @@ class SpecialEditTags extends UnlistedSpecialPage {
                $list = $this->getList();
                for ( $list->reset(); $list->current(); $list->next() ) {
                        $item = $list->current();
                $list = $this->getList();
                for ( $list->reset(); $list->current(); $list->next() ) {
                        $item = $list->current();
+                       if ( !$item->canView() ) {
+                               throw new ErrorPageError( 'permissionserrors', 'tags-update-no-permission' );
+                       }
                        $numRevisions++;
                        $out->addHTML( $item->getHTML() );
                }
                        $numRevisions++;
                        $out->addHTML( $item->getHTML() );
                }