Zend_Acl memory failure when checking permission with logical operators

105 views Asked by At

I am trying to implement a customized Acl Assert.

if($acl->isAllowed($role,$resource,$privilege.':all')) {
   return true; 
}

works fine. But

if(($acl->isAllowed($role,$resource,$privilege.':all')) 
     || ($acl->isAllowed($role,$resource,$privilege))) {
     return true; 
}

throws a

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261904 bytes) in ........\library\Zend\Acl.php on line 837

1

There are 1 answers

0
Octavian Vladu On

I had a similar problem. I've commented all ACL asserts from my model and

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261900 bytes) in /var/www/project/library/Zend/Acl.php on line 1109

became

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261900 bytes) in /var/www/project/application/models/User.php on line 17

which really meant that it was nothing wrong with ACL - I was calling a function from itself in a infinite recursive call.