This repository was archived by the owner on Jan 30, 2020. It is now read-only.
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Child roles not added #45
Open
Description
In v3.x, if you create a role, add a child role too it, then add the parent role to the Rbac instance, the child role is not added. Using your own example code:
use Zend\Permissions\Rbac\Rbac;
use Zend\Permissions\Rbac\Role;
$rbac = new Rbac();
$foo = new Role('foo');
$bar = new Role('bar');
$foo->addChild($bar);
$rbac->addRole($foo);
echo $rbac->hasRole("bar") ? "works" : "doesn't work";
This displays "doesn't work". Similarly, attempting a permission check against role "bar" raises a "No role with name 'bar' could be found" exception.
This worked in 2.x