我正在建立一个封闭的网站,其中有一个为每个人登陆的网页。
我正在使用ZfcUser和BjyAuthorize。现在一切都正常,但我想知道如何排除我的应用程序的Application\Controller\Index::index操作。
在我的module.bjyauthorize.global.php中,我告诉我的操作不需要身份验证:
'BjyAuthorize\Guard\Controller' => array(
array(
'controller' => 'Application\Controller\Index',
'action' => 'index',
'roles' => array()
),
// ...但我还是会被转发到ZFCUser登录页面。
知道我错过了什么吗?
编辑:
我尝试过使用guest角色,但到目前为止还没有成功:
'default_role' => 'guest',
'BjyAuthorize\Provider\Role\Config' => array(
'guest' => array(),
'user' => array(
'children' => array(
'admin' => array(),
),
),
),发布于 2013-03-13 12:10:58
注释:在1.2.*中有效
必须允许guest用户访问索引页:
'BjyAuthorize\Guard\Controller' => array(
array(
'controller' => 'Application\Controller\Index',
'action' => 'index',
'roles' => array('guest', 'user')
),
// ...你在问题中所定义的是否定
由于BjyAuthorize的控制器保护配置充当一个白名单,所以现在不允许访问所有角色。
https://stackoverflow.com/questions/15380963
复制相似问题