I've seen examples of ACL to deal with one entity but none to deal with fetching multiple items - such as a list of posts that belong to an author. One (bad) suggestion was to fetch all the items and then filter using acl - not going to work when we have a million items. What is the intended way to fetch multiple items - let's say I want to fetch all my posts (using any criteria I need such as published or ordered by) in batches of 50 for the pager (another reason why post filtering will not work - I'd end up with different page sizes).
I think, you shouldn't use ACL for determining which posts belong to a particular author because ACL is about access control / permissions, not about finding owners or determining object relations.
But certainly, you are perfectly ok to want to get a list of posts certain user can view, edit or moderate for example.
Currently, there is no functionality to do this on API level, but... well, I think in Symfony2 / Doctrine2 you can just do Native Query and join with acl_entries table.
But there is a drawback. In a large system acl_entries
table will contain just too much rows and joining against it can be slow (we know, that MySQL is stupid sometimes). So you might also want to build some kind of caching system around this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With