diff --git a/models/IssueContent.php b/models/IssueContent.php index c469fa1..a07704e 100644 --- a/models/IssueContent.php +++ b/models/IssueContent.php @@ -27,6 +27,8 @@ public function canView($user = null) { if ($user === null && !\Yii::$app->user->isGuest) { $user = \Yii::$app->user->getIdentity(); + } else if (!$user instanceof User) { + $user = User::findOne(['id' => $user]); } $visibility = (int)$this->visibility;