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;
}
/**
+ * @param UserProfile|null $user
* @inheritDoc
*/
- public function canModerate($objectTypeID, $objectID)
+ public function canModerate($objectTypeID, $objectID, ?UserProfile $user = null)
{
+ if ($user !== null) {
+ return $user->getPermission($this->permissionCanModerate) ? true : false;
+ }
return WCF::getSession()->getPermission($this->permissionCanModerate) ? true : false;
}
use wcf\data\comment\Comment;
use wcf\data\comment\response\CommentResponse;
+use wcf\data\user\UserProfile;
/**
* Default interface for comment managers.
public function canDeleteResponse(CommentResponse $response);
/**
- * Returns true if the current user may moderated content identified by
+ * Returns true if the current or given 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);
+ public function canModerate($objectTypeID, $objectID, ?UserProfile $user = null);
/**
* Returns the amount of comments per page.