Use spiffy navigation with zfcrbac module

2020-07-26 05:10发布

I'm trying to understand how spiffy-navigation works. I integrate the module, it's working very well. I have my navigation. But the doc says :

Rbac specific options

role: required The role to use to determine if access is granted.

permission: required The permission to use to determine if access is granted.

But, even if i did something like that, it still not working.

    'containers' => array(
            'default' => array(
                array(
                    'options' => array(
                        'label' => 'profil',
                        'route' => 'profil',
                        'role' => 'members',
                        'permission' => 'member'
                    ),
                    'pages' => array(
                        // ...
                    )
                )
            )
   ),

EDIT(May 27) : This is in fact a try of this discussion :ZF2 Generate navigation using zfcrbac zfcUser and hierarchical role strategy

My Question is the same : How to generate a dynamic navigation, for a user wich can only see links that is granted to access ?

For example when you write this :

<?php echo $this->navigation('navigation')->menu()->setUlClass('nav navbar-nav')?>

In our layout in ZF2 without zfcRbac we can specify getAcl(), setAcl(), getRole() and setRole(), gets and sets ACL (Zend\Permissions\Acl) but with zfcRbac this didn't work.

Spiffy Navigation need to be improved for doing that(it's the prototype of zf3 navigation). It's not the aim of ZfcRbac module.

if someone has a solution it would be nice.

0条回答
登录 后发表回答