Navigation ACL / accept doesn't work if an asserter is provided #19
Description
This issue has been moved from the zendframework
repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html
Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7614
User: @ceadreak
Created On: 2015-08-12T16:57:55Z
Updated At: 2015-11-06T22:14:04Z
Body
I have an issue in an application to hide parts of menu if acl resource is not allowed for a role.
I defined a member
role with a resource platform.ticketing
and a privilege access
.
Acl is defined such as below :
$this->allow('member', 'platform.ticketing', 'access', new HasTicketing());
HasTicketing
is a simple asserter returning true
if member can access or false
if not.
If I remove asserter, everything works fine but the menu appears ...
On my navigation config :
// ...
[
'label' => 'Ticketing',
'route' => 'platform/ticketing',
'resource' => 'platform.ticketing',
'privilege' => 'access',
],
// ...
On navigation partial :
// ...
foreach($this->container->getPages() as $page) {
if(!$page->isVisible() || !$this->navigation()->accept($page)) continue;
// ...
In the Xdebug trace, resource and privilege are OK, but $accept = false.
Acl works great for pages otherwise ...
Any idea for this issue ? Tks