From: Cyperghost Date: Thu, 21 Mar 2024 09:33:07 +0000 (+0100) Subject: Allow the `SessionHandler` as `$user` parameter, too X-Git-Tag: 6.1.0_Alpha_1~142^2~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ee8b210549eb81e86ce76fb58db153936fb5a791;p=GitHub%2FWoltLab%2FWCF.git Allow the `SessionHandler` as `$user` parameter, too --- 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 b2fb5fd579..3ecfbeb525 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -7,6 +7,7 @@ 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; @@ -162,7 +163,7 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme } #[\Override] - public function canModerateObject(int $objectTypeID, int $objectID, UserProfile $user): bool + public function canModerateObject(int $objectTypeID, int $objectID, SessionHandler|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 5500208cd3..99d8a1f6da 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php @@ -5,6 +5,7 @@ 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. @@ -77,7 +78,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, UserProfile $user): bool; + public function canModerateObject(int $objectTypeID, int $objectID, SessionHandler|UserProfile $user): bool; /** * Returns the amount of comments per page.