Closed fasi1208 closed 3 years ago
try this 'isAdmin' => Yii::$app->user->identity->user_role == 1,
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Yes - the isAdmin
property should be a boolean value (and must not be a function as you have done).
I have a tree in which I want to set
isAdmin
parametertrue
orfalse
based onuser_role
. I have done the following'isAdmin' => function(){ if (Yii::$app->user->identity->user_role == 1) { return true; } else { return false; } },
But I am getting an error
I don't know what I am missing.