I have a page architecture like this:
account-data
- 1010 (account, owner=clinton, assigned_users=brian)
- Some update
- Some project
- Some task
- 1020 (account, owner=jack, assigned_users=brian,clinton)
- 1030 (account, owner=tom, assigned_users=clinton)
- 1040 (account, owner=jordan, assigned_users=brian)
What I want to do is give viewing permissions (for updates, projects and tasks) to users only if they are either assigned or own the parent account.
I need to find out a clean way of doing this. For example, I could do:
foreach($pages->find("template=task") as $item) { if($item->parents()->find("template=account,user|assigned_user={$user}")) ...
But looping through all of the items is a pretty heavy task.
Sometimes it has to go a few levels before finding the parent with the user info.
Is there a better way of doing this?





Find content
Not Telling

