BjyAuthorize:父角色ID"用户"不存在

时间:2014-09-25 09:41:34

标签: zend-framework2 zfcuser bjyauthorize

我遇到Parent Role id "user" does not exist错误

我试图让BjyAuthorize工作。在我的配置中,我有

'bjyauthorize' => array(
    // Using the authentication identity provider, which basically reads the roles from the auth service's identity
    'identity_provider' => 'BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider',

    'resource_providers' => [
        'BjyAuthorizeProviderResourceConfig' => [
            'user' => [],

        ],
    ],

    'role_providers'        => array(
        // using an object repository (entity repository) to load all roles into our ACL
        'BjyAuthorize\Provider\Role\ObjectRepositoryProvider' => array(
            'object_manager'    => 'doctrine.entity_manager.orm_default',
            'role_entity_class' => 'SorgcaUser\Entity\Role',
        ),


        'BjyAuthorizeProviderResourceConfig' => array(
            'allow' => array(
                array('user', 'admin', 'manage'),
            ),
        ),
    ),
),

在我的控制器中,我只需拨打$this->isAllowed('admin', 'manage');

现在,调用isAllowed函数会抛出错误,说明我的父角色ID不存在

但是,在我的user_role表中,我有

enter image description here

我不确定如何开始调试。请指教。

0 个答案:

没有答案