我已经设置了bjyoungblood/bjy-authorize
模块,但目前403
每个 URL 都出现“访问被拒绝”错误,除了home
路由中配置的 URL。
我的module.byjauthorize.global.php
样子如下:
'bjyauthorize' => array(
'guards' => array(
'BjyAuthorize\Guard\Controller' => array(
array('controller' => 'index', 'action' => 'index', 'roles' => array('guest','user')),
array('controller' => 'index', 'action' => 'stuff', 'roles' => array('user')),
array('controller' => 'zfcuser', 'roles' => array()),
//backend
array('controller' => 'Application\Controller\Index', 'roles' => array('admin')),
array('controller' => 'MyModule\MyEntity\MyEntity', 'roles' => array('admin')),
),
'BjyAuthorize\Guard\Route' => array(
array('route' => 'zfcuser', 'roles' => array('user')),
array('route' => 'zfcuser/logout', 'roles' => array('user')),
array('route' => 'zfcuser/login', 'roles' => array('guest')),
array('route' => 'zfcuser/register', 'roles' => array('guest')),
array('route' => 'home', 'roles' => array('admin')),
array('route' => 'my-entity', 'roles' => array('admin')),
),
),
),
我尝试删除该BjyAuthorize\Guard\Route
部分,但没有任何效果。当我删除home
路线时,主页也会被阻止。所以 Controller- 和 Route-Guard 似乎都可以工作。如何调试此行为?