On 13/mar/07, at 20:02:02, Teemu Välimäki wrote:

Hi,

I'm not quite sure how I should use ACL with Views. I have a menu where I'd like items not to be visible if users role(s) have no access to it. So I was planning on doing array of the menu items and passing that to the view or passing the whole ACL object to view.

Views should not contain logic so I'd be very glad to see a short example or explanation how to do this, to prevent wrong implementation.

Virtual cookie for the one helping me out :)

Definitely go for the array of menu items. A simple rule to follow is give the view simple data structures only. Otherwise, should your application code switch from Zend_Acl to something else, you would need to change every view involved.

Federico

Reply via email to