Is it better to apply ACL only to parent entities?

New topics about Symfony 2 should go here

Moderators: tiagojsag, dcobalt

Is it better to apply ACL only to parent entities?

Postby denis_ » Wed Feb 29, 2012 6:35 am

Hi, I have a situation in which I have a hierarchical structure of entities:

Apartment > Floors > LeaseTerm (Apartment has many floors, floors have many lease terms).

I was wandering whether I should apply ACL to all these entities to perform easier checks for entity ownership, or should I just apply ACL ownership to the highest ranked entity (apartment) and then check the ownership of lower ranked entities through this entity? Would save me some code, I suppose - but I'm not sure whether this is a good idea.

I posted a similar question on Stack Overflow (http://stackoverflow.com/questions/9446 ... d-entities ) but got no response.
denis_
Member
 
Posts: 47
Joined: Sun Sep 04, 2011 2:04 am

Re: Is it better to apply ACL only to parent entities?

Postby bjo3rn » Wed Feb 29, 2012 10:21 am

Hi,

if 'Apartment' is an aggregate root I think it's OK to apply ACL to the topmost entity but that depends on how the related entities are accessed.

Regards,
Bjoern
User avatar
bjo3rn
Faithful Member
 
Posts: 1244
Joined: Fri Jun 17, 2011 10:03 am
Location: Germany


Return to General Symfony 2 discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron