Closed niqingyang closed 5 months ago
userHasPermission cannot detect permissions under the role when there is only one record in table yii_rbac_item_child
userHasPermission
$manager = new \Yiisoft\Rbac\Manager( new \Yiisoft\Rbac\Db\ItemsStorage($db, 'yii_rbac_item', 'yii_rbac_item_child'), new \Yiisoft\Rbac\Db\AssignmentsStorage($db, 'yii_rbac_assignment') ); $manager->addRole(new \Yiisoft\Rbac\Role('admin')); $manager->addPermission(new \Yiisoft\Rbac\Permission('post:create')); $manager->addChild('admin', 'post:create'); $manager->assign('admin', 1); $result = $manager->userHasPermission(1, 'post:create');
$result is true
true
$result is false
false
What steps will reproduce the problem?
userHasPermission
cannot detect permissions under the role when there is only one record in table yii_rbac_item_childWhat is the expected result?
$result is
true
What do you get instead?
$result is
false
Additional info