ZF-5964: Zend_Acl::Zend_Acl_Resource - equal childs for different parents
Description
Hi.
I have structure of Resourses
Parent1 - ( can be House #1) Child1 - ( can be Flat #1) Parent2 - ( can be House #2)
Child1 - ( can be Flat #1)
So i can't do this 1: $acl->add(new Zend_Acl_Resource('Parent1')); 2: $acl->add(new Zend_Acl_Resource('Parent2'));
3: $acl->add(new Zend_Acl_Resource('Child1'),'Parent1'); 4: $acl->add(new Zend_Acl_Resource('Child1'),'Parent2');
While complie i see message Child1 allready present in resource list - error in line 4.
Thanks.
Comments
Posted by Peter Moolenaar (petermoolenaar) on 2009-04-01T05:59:50.000+0000
Hi,
I would expect the resources to behave in a similar way to the roles. Is there a concrete reason this was implemented as is? I mean, was the before mentioned case simply overlooked or is there a more subtle reason.
Regards, Peter
Posted by Ralph Schindler (ralph) on 2009-09-10T09:46:29.000+0000
I actually have a hard time understanding the use case where resources need to be inherited from multiple parents aside from the more technical demonstration in the issue report. Do you have a real world use case?
While this might be a worthwhile feature, the ZF team will not develop this feature, but if a community member would like to pick up and develop it, they may make an assignment of it.
Posted by Peter Moolenaar (petermoolenaar) on 2009-09-10T10:08:32.000+0000
When imagining one flat being part of 2 houses is indeed quite hard, a real life situation would be to define access control based through different paths.
For example when defining a road to be both a side-walk and a cycleway Or maybe a room to be a lecture room and a project room
Posted by Beth Macknik (macknik) on 2009-10-25T06:47:28.000+0000
Does this example make the issue a little clearer?
Parent1 - ( is Condo #1 ) Child1 - ( is Swimming Pool ) Parent2 - ( is Condo #2 ) Child1 - ( is Swimming Pool )
There is only one swimming pool in the condo complex. To get access to the swimming pool you must have access to one or more condos.
Posted by Thomas Weidner (thomas) on 2010-03-21T10:28:14.000+0000
Reassigned to component maintainer
Posted by Andries Seutens (andries) on 2012-03-27T17:47:59.000+0000
Resources are arranged as a tree, a tree node can not have > 1 parent.
The interface "Resource" has a method "getResourceId()". According to the architecture of Zend_Acl, this ID should be unique (identity pattern).