Allow users that may manage own articles to view them independent of publication...
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:03:05 +0000 (14:03 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:28:20 +0000 (14:28 +0200)
wcfsetup/install/files/lib/data/article/Article.class.php

index 637b93c5023044234275179358333db678bdf7cf..b2fe2ba7e295c59b8ee52ecd70b7071b42450ce2 100644 (file)
@@ -112,12 +112,21 @@ class Article extends DatabaseObject implements ILinkableObject, IUserContent
             $user = new UserProfile(WCF::getUser());
         }
 
-        if ($this->isDeleted && !$user->getPermission('admin.content.article.canManageArticle')) {
-            return false;
+        if ($this->isDeleted) {
+            if (
+                !$user->getPermission('admin.content.article.canManageArticle')
+                && !($user->getPermission('admin.content.article.canManageOwnArticles') && $this->userID == $user->userID)
+            ) {
+                return false;
+            }
         }
 
         if ($this->publicationStatus != self::PUBLISHED) {
-            if (!$user->getPermission('admin.content.article.canManageArticle') && (!$user->getPermission('admin.content.article.canContributeArticle') || $this->userID != $user->userID)) {
+            if (
+                !$user->getPermission('admin.content.article.canManageArticle')
+                && !($user->getPermission('admin.content.article.canManageOwnArticles') && $this->userID == $user->userID)
+                && !($user->getPermission('admin.content.article.canContributeArticle') && $this->userID == $user->userID)
+            ) {
                 return false;
             }
         }