From f370c23af93232d2f8c4bb80ed7ca9b96cb851c1 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 22 Mar 2024 11:31:34 +0100 Subject: [PATCH] Revert "Allow the `SessionHandler` as `$user` parameter, too" This reverts commit ee8b210549eb81e86ce76fb58db153936fb5a791. --- .../system/comment/manager/AbstractCommentManager.class.php | 3 +-- .../files/lib/system/comment/manager/ICommentManager.class.php | 3 +-- 2 files changed, 2 insertions(+), 4 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 3ecfbeb525..b2fb5fd579 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -7,7 +7,6 @@ use wcf\data\comment\response\CommentResponse; use wcf\data\DatabaseObjectDecorator; use wcf\data\user\UserProfile; use wcf\system\bbcode\BBCodeHandler; -use wcf\system\session\SessionHandler; use wcf\system\SingletonFactory; use wcf\system\WCF; @@ -163,7 +162,7 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme } #[\Override] - public function canModerateObject(int $objectTypeID, int $objectID, SessionHandler|UserProfile $user): bool + public function canModerateObject(int $objectTypeID, int $objectID, UserProfile $user): bool { return (bool)$user->getPermission($this->permissionCanModerate); } 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 99d8a1f6da..5500208cd3 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.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\user\UserProfile; -use wcf\system\session\SessionHandler; /** * Default interface for comment managers. @@ -78,7 +77,7 @@ interface ICommentManager * Returns true if the user may moderate content identified by * object type id and object id. */ - public function canModerateObject(int $objectTypeID, int $objectID, SessionHandler|UserProfile $user): bool; + public function canModerateObject(int $objectTypeID, int $objectID, UserProfile $user): bool; /** * Returns the amount of comments per page. -- 2.20.1