Skip to content

Commit b7180b2

Browse files
committed
fix User::isAdmin to check admin access for model user instead of Yii::$app->user
1 parent 8fd41d2 commit b7180b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getIsAdmin()
122122
{
123123
return
124124
(\Yii::$app->getAuthManager() && $this->module->adminPermission ?
125-
\Yii::$app->user->can($this->module->adminPermission) : false)
125+
\Yii::$app->authManager->checkAccess($this->id, $this->module->adminPermission) : false)
126126
|| in_array($this->username, $this->module->admins);
127127
}
128128

0 commit comments

Comments
 (0)