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

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

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.

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

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.

Reassigned to component maintainer

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).