Zend Framework

Assertion implementation does not receive ACL query parameters.

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.2, 1.7.3
  • Fix Version/s: 1.9.1
  • Component/s: Zend_Acl
  • Labels:
    None

Description

Zend_Acl manual states that:

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.

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

$acl::allow(null,null,null,new MyAssertion());

... with the assertion built like:

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:

$acl->isAllowed('someRole','someResource','somePermission');

... 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)

Issue Links

Activity

Hide
Wil Sinclair added a comment -

Assigning to Ralph to get closure on this issues.

Show
Wil Sinclair added a comment - Assigning to Ralph to get closure on this issues.
Hide
Ralph Schindler added a comment -

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

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

Fixed with 1.9.1

Show
Ralph Schindler added a comment - Fixed with 1.9.1

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: