Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Navigation ACL / accept doesn't work if an asserter is provided #19

Open
GeeH opened this issue Jun 28, 2016 · 1 comment
Open

Navigation ACL / accept doesn't work if an asserter is provided #19

GeeH opened this issue Jun 28, 2016 · 1 comment

Comments

@GeeH
Copy link
Contributor

GeeH commented Jun 28, 2016

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


@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-permissions-acl; a new issue has been opened at https://github.com/laminas/laminas-permissions-acl/issues/3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants