ZF-1765: Asserts don't get role, resource and privilege parameters unless specified in allow()

Issue Type: Bug Created: 2007-07-24T13:32:00.000+0000 Last Updated: 2008-03-21T16:25:38.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Martin Pärtel (lagitus) Assignee: Darby Felton (darby) Tags: - Zend_Acl

Related issues: - ZF-1722



Zend_Acl_Assert_Interface::assert() gets nulls for $role, $resource and $privilege if those parameters are omitted in the allow() call. According to the manual, this is not the expected behaviour (as far as I can tell): "The assert() method of an assertion object is passed the ACL, Role, Resource, and privilege to which the authorization query (i.e., isAllowed()) applies, in order to provide a context for the assertion class to determine its conditions where needed."

Example case: $siteAcl = new Zend_Acl(); $siteAcl->add(new Zend_Acl_Resource('myres')); $siteAcl->addRole(new Zend_Acl_Role('myrole'));

class MyAssert implements Zend_Acl_Assert_Interface { public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null, $privilege = null) { echo '


pre>'; var_dump($role); var_dump($resource); var_dump($privilege); } }

$siteAcl->allow(null, null, null, new MyAssert()); //$siteAcl->allow('myrole', 'myres', 'somepriv', new MyAssert()); // << using this line instead, assert() gets the parameters $siteAcl->isAllowed('myrole', 'myres', 'somepriv');


Posted by Thomas Weidner (thomas) on 2007-07-25T00:38:06.000+0000

Assigned to Darby

Posted by Darby Felton (darby) on 2007-08-01T15:00:26.000+0000

Duplicates [ZF-1722].

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.