ZF2-222: Resource tied to parent
Description
Hi folks,
The following code won't work:
$acl->addResource('funcA','classA'); $acl->addResource('funcA','classB');
It didn't do it in ZF1 and also doesn't appear to do it in ZF2. We recently came across it in a project.
It would be great if this could be namespace related or named. The obvious work around is:
$acl->addResource('classA_funcA','classA'); $acl->addResource('classB_funcA','classB');
Thanks
Antony
Comments
Posted by Andries Seutens (andries) on 2012-03-22T19:19:46.000+0000
Resources are arranged as a tree, a tree node can not have > 1 parent.
It would be helpful if you explained what you are trying to accomplish?
Posted by Antony (ukuser30) on 2012-03-24T10:46:56.000+0000
What I mean is that if you are creating an ACL which is using method names as the id and class names as the parent, you cannot have a resource with the same name even if it has a different parent. You would expect a parent to be able to have a child resource with the same name as another parents child.
Posted by Andries Seutens (andries) on 2012-03-26T17:54:55.000+0000
The interface "Resource" has a method "getResourceId()". According to the architecture of Zend\Acl, this ID should be unique (identity pattern).
Posted by Andries Seutens (andries) on 2012-03-27T17:48:57.000+0000
Duplicate of #ZF-5964, which I just marked as "won't fix". It's a fundamental design of Zend\Acl.