ZF-5425: Assertion implementation does not receive ACL query parameters.

Issue Type: Bug Created: 2009-01-07T07:49:09.000+0000 Last Updated: 2009-08-14T13:41:31.000+0000 Status: Resolved Fix version(s): - 1.9.1 (11/Aug/09)

Reporter: Artur Bodera (joust) Assignee: Ralph Schindler (ralph) Tags: - Zend_Acl

Related issues: - ZF-1722



Zend_Acl manual states that:

{quote} 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. {quote}

That is not true! When assertion is attached to global "all-roles" pseudo-parent in on ACL tree with:

<pre class="highlight">
$acl::allow(null,null,null,new MyAssertion());

... with the assertion built like:

<pre class="highlight">
class MyAssertion 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)
        if($role == 'someRole') return true;
        elseif($resource == 'someBannedResource') return false;        
        else return true;

... Then after a query:

<pre class="highlight">

... the assertion should be called with

assert(Zend_Acl object, 'somerole', 'someResource', 'somePermission').

Instead it is called with

assert(Zend_Acl object, null, null, null)


Posted by Wil Sinclair (wil) on 2009-01-14T13:31:40.000+0000

Assigning to Ralph to get closure on this issues.

Posted by Ralph Schindler (ralph) on 2009-07-30T18:53:37.000+0000

There is a fix in place in trunk at r17317 for ZF-1721 & ZF-1722 that I think will fix this issue, please test.

Posted by Ralph Schindler (ralph) on 2009-08-14T13:41:30.000+0000

Fixed with 1.9.1

Have you found an issue?

See the Overview section for more details.


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

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