A system has nested resources. For example
Farm HasMany Sectors
An example object relation will be like below
- farm1 => [sector1]
- farm2 => [sector2, sector3]
Now say, user1
has read,write permission on farm1
.
user1 Has(read,write) on farm1
I need the system to automatically use the access for all the nested resources of farm1
, in this case sector1
.
In other words, something like user1.hasWritePermisson(sector1)
should return true, though the ACL is actually stored with farm1
. I need this even to work on the nested resources of sector and so on.
A straightforward solution would probably be to copy the access to all of the children objects of farm1 at the updating its acl. But I believe this would be a really inefficient one if farm1 contains thousands of sectors.
What would be the best way to achieve this in symfony2?