1

我有一个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桌子上,我有

在此处输入图像描述

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

4

0 回答 0