From: Tim Düsterhus Date: Tue, 28 Mar 2023 12:03:05 +0000 (+0200) Subject: Allow users that may manage own articles to view them independent of publication... X-Git-Tag: 5.5.11_dev_1~11^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76e1d4b359ab03326c91cb6eb77f5ce8b785e084;p=GitHub%2FWoltLab%2FWCF.git Allow users that may manage own articles to view them independent of publication status --- diff --git a/wcfsetup/install/files/lib/data/article/Article.class.php b/wcfsetup/install/files/lib/data/article/Article.class.php index 637b93c502..b2fe2ba7e2 100644 --- a/wcfsetup/install/files/lib/data/article/Article.class.php +++ b/wcfsetup/install/files/lib/data/article/Article.class.php @@ -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; } }