ZF-2257: Zend_Acl - access control list processing error
Bug example follows:
require_once 'Zend/Acl.php'; require_once 'Zend/Acl/Resource.php'; require_once 'Zend/Acl/Role.php'; $acl = new Zend_Acl(); $acl->addRole(new Zend_Acl_Role('foo')); $acl->add(new Zend_Acl_Resource('bar')); $acl->allow('foo','bar'); $acl->deny('foo'); echo 'access to bar by foo is '.($acl->isAllowed('foo','bar') ? 'allowed' : 'denied');
I've encountered an error during processing simple ACL. First, we allow acces to resource 'bar' by 'foo' role, and then we deny access to all resources by this role. Expecting result is 'denied', but unfortunately 'allowed' appears on screen...
ACL works as expected when we explictly pass a resource to deny method, - try change last acl line to: