Skip to content

Commit

Permalink
Added test for zendframework#3454.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Kiers committed Jan 18, 2013
1 parent 0bb9585 commit 07e4245
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/ZendTest/Permissions/Acl/AclTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1303,4 +1303,21 @@ public function testRemoveDenyWithNullResourceAppliesToAllResources()
$this->assertFalse($this->_acl->isAllowed('guest', 'newsletter', 'read'));
}

/**
* @group ZF2-5434
*/
public function testAclResourcePermissionsAreInheritedWithMultilevelResources()
{
$this->_acl->addRole('guest');
$this->_acl->addResource('blogposts');
$this->_acl->addResource('feature', 'blogposts');
$this->_acl->addResource('post_1', 'feature');

$this->_acl->deny();
$this->_acl->allow('guest', 'feature', 'read');

$this->assertFalse($this->_acl->isAllowed('guest', 'feature', 'write'));
$this->assertTrue($this->_acl->isAllowed('guest', 'post_1', 'read'));
}

}

0 comments on commit 07e4245

Please sign in to comment.