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
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]