Well, I have fields to show/hide on different conditions for example. Consider show/hide person salary. If user has entered secret password (this would be the assert) he will be allowed to see someone's salary else just a link will be presented to enter secret password. But on other hand if there is not even allow for this salaray to see I wouldn't even display link to enter secret pass...it will all be just hidden. Hope it makes more sense now.
I like abstraction too.....just kinda not sure what best approach in my case is. Colin Guthrie wrote: > Julian Davchev wrote: >> Hi, >> Lets say I have this snippet >> >> ....some code already for creating acl object.... >> $acl->allow('baby','house','break',$hadMilk); >> >> So how do I know i >> $isAllowed = $acl->isAllowed('baby','house','break'); >> // so if $isAllowed === false how do I know this is due to $hadMilk >> assert is false or just no such allow rule there? > > I think a question I would ask is why do you need to know this? > > Abstraction is good! Zend_ACL is a system that allows this > abstraction. If you want to know the reasons why your ACL fails, then > just check each condition manually and don't use the Zend_ACL system > at all! > > > I guess you could throw an exception or set something in a registry in > your assert method if you really want to bubble this info up to the > calling code, but I'd think seriously about the reasons behind doing > this before going down this route. > > Col > > >