<?php namespace common\components; use Yii; class PhpManager extends \yii\rbac\PhpManager { public function init() { parent::init(); } public function getAssignments($userId) { if (!Yii::$app->user->isGuest) { $assignment = new \yii\rbac\Assignment; $assignment->userId = $userId; $assignment->roleName = Yii::$app->user->identity->role; return [$assignment->roleName => $assignment]; } } }
thx
thanks… you saved my day !! 🙂
how can i check back the rolename?
How do you mean?
you save my life … i waste my time for 2 days to find solution like this ,, tq for the post:))