Unify visibility of articles in ACP's article list with frontend
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:17:40 +0000 (14:17 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:28:21 +0000 (14:28 +0200)
wcfsetup/install/files/lib/acp/page/ArticleListPage.class.php

index d852e9fdce35a2ecc53fffd853d2f98d8094c51c..4f204fa3215ed4ced23a9730665a5d76287dd216 100644 (file)
@@ -2,9 +2,8 @@
 
 namespace wcf\acp\page;
 
-use wcf\data\article\Article;
+use wcf\data\article\AccessibleArticleList;
 use wcf\data\article\ArticleList;
-use wcf\data\article\ViewableArticleList;
 use wcf\data\category\CategoryNodeTree;
 use wcf\data\user\User;
 use wcf\page\SortablePage;
@@ -34,7 +33,7 @@ class ArticleListPage extends SortablePage
     /**
      * @inheritDoc
      */
-    public $objectListClassName = ViewableArticleList::class;
+    public $objectListClassName = AccessibleArticleList::class;
 
     /**
      * @inheritDoc
@@ -179,15 +178,6 @@ class ArticleListPage extends SortablePage
                 ['%' . $this->content . '%']
             );
         }
-        if (!WCF::getSession()->getPermission('admin.content.article.canManageArticle')) {
-            // only show own articles
-            $this->objectList->getConditionBuilder()->add('article.userID = ?', [WCF::getUser()->userID]);
-
-            if (!WCF::getSession()->getPermission('admin.content.article.canManageOwnArticles')) {
-                // only show unpublished articles
-                $this->objectList->getConditionBuilder()->add('article.publicationStatus = ?', [Article::UNPUBLISHED]);
-            }
-        }
 
         $this->objectList->sqlSelects = "(
             SELECT  title