Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit b856da4

Browse files
committed
Fixed bug for IssueContent::canView(userId) when userId is string
1 parent 8f93ade commit b856da4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

models/IssueContent.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public function canView($user = null)
2727
{
2828
if ($user === null && !\Yii::$app->user->isGuest) {
2929
$user = \Yii::$app->user->getIdentity();
30+
} else if (!$user instanceof User) {
31+
$user = User::findOne(['id' => $user]);
3032
}
3133

3234
$visibility = (int)$this->visibility;

0 commit comments

Comments
 (0)