Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Config for version 3.0 needs some fixing or explaining #389

@svycka

Description

@svycka

for zf3 project I ended up with this:

<?php
$config = (new \ZfcRbac\ModuleConfig())();
return [
    'service_manager' => [
        'factories' => array_merge($config['dependencies']['factories'], [
            \ZfcRbac\Role\RoleProviderInterface::class => \ZfcRbac\Container\ObjectRepositoryRoleProviderFactory::class,
        ]),
    ],
    'zfc_rbac' => [
        'guest_role' => 'guest',
        'role_provider' => [
            \ZfcRbac\Role\ObjectRepositoryRoleProvider::class => [
                'object_manager' => 'doctrine.entitymanager.orm_default',
                'class_name' => \OAuth2Server\Entity\HierarchicalRole::class,
                'role_name_property' => 'name',
            ],
        ],
        // Assertion plugin manager
        'assertion_manager' => [],
    ],
];

Not that bad but still maybe someone can suggest something better? Maybe we should support ZF and expressive by default since we have everything ready for them? And also not existing documentation.

Also noticed that we use $container->get('config') I think this is ZF thing or do other frameworks have it? for example here: https://github.com/ZF-Commons/zfc-rbac/blob/develop/src/Container/ModuleOptionsFactory.php#L37

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions