Use spiffy navigation with zfcrbac module

99封情书 提交于 2019-12-21 21:10:40

问题


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.

来源:https://stackoverflow.com/questions/23032619/use-spiffy-navigation-with-zfcrbac-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!