hasAcl dosn't cheks $defaultAcl Member Variable #3507

zf2timo opened this Issue Jan 21, 2013 · 0 comments


None yet
2 participants

zf2timo commented Jan 21, 2013

The function hasAcl in NavigationHelper dosn't check the defaultACL member variable. In my opinion its a bug, because if you call the ''getACL'' method, it returns the default ACL.
So i worte a Unit Test that fails:

    public function testHasACLChecksDefaultACL()
        $aclContainer = $this->_getAcl();
        /** @var $acl \Zend\Permissions\Acl\Acl */
        $acl = $aclContainer['acl'];

        $this->assertEquals(false, $this->_helper->hasACL());
        $this->assertEquals(true, $this->_helper->hasAcl());

And in my fork, you can see the changed method https://github.com/zf2timo/zf2/blob/master/library/Zend/View/Helper/Navigation/AbstractHelper.php#L568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment