ZF2-222: Resource tied to parent

Issue Type: Improvement Created: 2012-03-13T19:55:33.000+0000 Last Updated: 2012-03-27T17:48:57.000+0000 Status: Closed Fix version(s): Reporter: Antony (ukuser30) Assignee: Ralph Schindler (ralph) Tags: - Zend\Acl

Related issues: Attachments:


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');




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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.