Suppose I have the classes/models
- Projects (has many lists)
- Lists
I want to allow only users that are collaborators of a project to be able to add lists. How do I do that. I know I should use Zend_Acl_Assert but what do I pass as the resource. For edit/delete I will pass the list itself. For add it seems more like it should be a project. Which seems more correct if I move the ListsController#addAction() to ProjectsController#addListAction()? This is 1 possibility
But if I want to do something like ListsController#addAction() how can I setup my acl?
$acl->allow('user', 'list', 'add', new assertClass());
Will pass ‘list’ as the resource. Can I somehow pass a project object instead? It does not seem to make sense tho
As long as the object implements
Zend_Acl_Resource_Interfaceand has been registered in the ACL, you can use anything you want.