From 4d57ad2584d08a7e5070b8c6e0f61d8062de21a3 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Mon, 25 Mar 2024 11:00:44 +0100 Subject: [PATCH] Run php-cs-fixer --- .../system/comment/manager/ArticleCommentManager.class.php | 1 + .../comment/manager/ModerationQueueCommentManager.class.php | 3 ++- .../lib/system/comment/manager/PageCommentManager.class.php | 1 + .../comment/manager/UserProfileCommentManager.class.php | 6 ++++-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php index 4ee1c76c56..834e6caea5 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php @@ -82,6 +82,7 @@ class ArticleCommentManager extends AbstractCommentManager implements IViewableL if (!$articleContent->getArticle()->canRead($user)) { return false; } + return (bool)$user->getPermission($this->permissionCanModerate); } diff --git a/wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php index ea81183be4..9ebc60ddd2 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php @@ -30,7 +30,8 @@ class ModerationQueueCommentManager extends AbstractCommentManager implements IC public function canModerateObject(int $objectTypeID, int $objectID, UserProfile $user): bool { $entry = new ModerationQueue($objectID); - return ($entry->canEdit($user->getDecoratedObject())); + + return $entry->canEdit($user->getDecoratedObject()); } /** diff --git a/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php index d74209da1e..ee0c2294e3 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php @@ -81,6 +81,7 @@ class PageCommentManager extends AbstractCommentManager implements IViewableLike if (!$page->isAccessible($user->getDecoratedObject())) { return false; } + return (bool)$user->getPermission($this->permissionCanModerate); } diff --git a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php index 0727551ccc..3738efe6ce 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php @@ -104,12 +104,14 @@ class UserProfileCommentManager extends AbstractCommentManager implements /** @see UserProfile::isProtected() */ if ( !( - $user->getPermission('admin.general.canViewPrivateUserOptions') + $user->getPermission('admin.general.canViewPrivateUserOptions') || $userProfile->isAccessible('canViewProfile', $user->userID) - || $userProfile->userID === $user->userID) + || $userProfile->userID === $user->userID + ) ) { return false; } + return (bool)$user->getPermission($this->permissionCanModerate); } -- 2.20.1