Hi!
Actually the question. Create role create permission, attach a permission to the role. Add the role to the user.
But why is a user with this role the access is not receiving.
As:
$auth = \Yii::$app->authManager;
$admin = $auth->createRole('admin');
$auth->add($admin);
$showFilter = $auth->createPermission('showFilter');
$showFilter->description = "Show filter";
$auth->add($showFilter);
$auth->addChild($admin, $showFilter);
$auth->assign($admin, 76);
But calling
Yii::$app->user->can('showFilter')
why it returns false. Help to understand why. Did everything according to the documentation. As there is
Authorization
UPDATE:
If you write
Yii::$app->user->can('admin')
the access is, not running it through the "permission" attached to the role. Even if the role of the role of cabling, access via the child role he gets (