Lastest news for classes zfcuser, bjyauthorize and orm

585 views Asked by At

I am working with zfcuser, zfcuser-doctrine-orm and bjyauthorize but I'm not sure on how to handle all the configurations. I have setted

return array(
    'bjyauthorize' => array(
        // default role for unauthenticated users
        'default_role' => 'guest',
        // default role for authenticated users (if using the
        // 'BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider' identity provider)
        'authenticated_role' => 'user',
        // identity provider service name
        'identity_provider' => 'BjyAuthorize\Provider\Identity\AuthenticationDoctrineEntity',
        // Role providers to be used to load all available roles into Zend\Permissions\Acl\Acl
        // Keys are the provider service names, values are the options to be passed to the provider
        'role_providers' => array(
            /* here, 'guest' and 'user are defined as top-level roles, with
             * 'admin' inheriting from user
             */
            'BjyAuthorize\Provider\Role\DoctrineEntity' => array(
                'role_entity_class' => 'Application\Entity\Role',
            ),

[...]

(I am using BjyAuthorize\Provider\Role\DoctrineEntity as suggested by @ocramius on Add BjyAuthorize Roles (using ZfcUser and Doctrine))

But "BjyAuthorize\Provider\Role\DoctrineEntity" does not exists in the module and it's not in the factories. I tried to use:

'BjyAuthorize\Provider\Role\DoctrineEntity' => 'BjyAuthorize\Service\DoctrineEntityRoleProviderFactory',

But it does not work:

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotCreatedException' with message 'While attempting to create bjyauthorizeproviderroledoctrineentity(alias: BjyAuthorize\Provider\Role\DoctrineEntity) an invalid factory was registered for this instance type.' in D:\wamp\www\vidum\src\vendor\zendframework\zendframework\library\Zend\ServiceManager\ServiceManager.php on line 860

Does anyone know which is the class for this factory?

1

There are 1 answers

0
Steve Jordan On

The correct class to hook up a Doctrine role provider is

BjyAuthorize\Provider\Role\ObjectRepositoryProvider

You can see an example setup in the docs.