From 2d9b5d0f627db310ff2a9a8b18d0bf76654ea7b2 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Thu, 21 Mar 2024 10:19:17 +0100 Subject: [PATCH] Revert "Add a user parameter to check whether the user is allowed to moderate this comment." This reverts commit 8005d38adb57834864e7c7736193568d80d83813. --- .../comment/manager/AbstractCommentManager.class.php | 7 +------ .../lib/system/comment/manager/ICommentManager.class.php | 6 ++---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php index 7a1a8d0163..33c2ac4466 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -5,7 +5,6 @@ namespace wcf\system\comment\manager; use wcf\data\comment\Comment; use wcf\data\comment\response\CommentResponse; use wcf\data\DatabaseObjectDecorator; -use wcf\data\user\UserProfile; use wcf\system\bbcode\BBCodeHandler; use wcf\system\SingletonFactory; use wcf\system\WCF; @@ -154,14 +153,10 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme } /** - * @param UserProfile|null $user * @inheritDoc */ - public function canModerate($objectTypeID, $objectID, ?UserProfile $user = null) + public function canModerate($objectTypeID, $objectID) { - if ($user !== null) { - return $user->getPermission($this->permissionCanModerate) ? true : false; - } return WCF::getSession()->getPermission($this->permissionCanModerate) ? true : false; } diff --git a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php index 91b502e11c..90bb0602d2 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php @@ -4,7 +4,6 @@ namespace wcf\system\comment\manager; use wcf\data\comment\Comment; use wcf\data\comment\response\CommentResponse; -use wcf\data\user\UserProfile; /** * Default interface for comment managers. @@ -63,15 +62,14 @@ interface ICommentManager public function canDeleteResponse(CommentResponse $response); /** - * Returns true if the current or given user may moderated content identified by + * Returns true if the current user may moderated content identified by * object type id and object id. * * @param int $objectTypeID * @param int $objectID - * @param UserProfile|null $user * @return bool */ - public function canModerate($objectTypeID, $objectID, ?UserProfile $user = null); + public function canModerate($objectTypeID, $objectID); /** * Returns the amount of comments per page. -- 2.20.1