Commit 61d55d4a authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Migration vers laminas

parent 88ad2638
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -15,16 +15,16 @@ As long-term support for Zend Framework 2 ended on 2018-03-31, any users who cur
[![Latest Unstable Version](https://poser.pugx.org/bjyoungblood/bjy-authorize/v/unstable.png)](https://packagist.org/packages/bjyoungblood/bjy-authorize)
[![Dependency Status](https://www.versioneye.com/package/php--bjyoungblood--bjy-authorize/badge.png)](https://www.versioneye.com/package/php--bjyoungblood--bjy-authorize)

This module is designed to provide a facade for `Zend\Permissions\Acl` that will
This module is designed to provide a facade for `Laminas\Permissions\Acl` that will
ease its usage with modules and applications. By default, it provides simple
setup via config files or by using `Zend\Db` or Doctrine ORM/ODM (via ZfcUserDoctrineORM).
setup via config files or by using `Laminas\Db` or Doctrine ORM/ODM (via ZfcUserDoctrineORM).

## What does BjyAuthorize do?

BjyAuthorize adds event listeners to your application so that you have a "security" or "firewall" that disallows
unauthorized access to your controllers or routes.

This is what a normal `Zend\Mvc` application workflow would look like:
This is what a normal `Laminas\Mvc` application workflow would look like:

![Zend Mvc Application workflow](http://yuml.me/diagram/plain;/activity/%28start%29-%3E%28route%29%2C%20%28route%29-%3E%28get%20controller%29%2C%20%28get%20controller%29-%3E%28dispatch%29%2C%20%28dispatch%29-%3E%28end%29)

@@ -51,7 +51,7 @@ php composer.phar require zf-commons/zfc-user:0.1.*

## Configuration

Following steps apply if you want to use `ZfcUser` with `Zend\Db`. If you want to use Doctrine ORM/ODM, you should
Following steps apply if you want to use `ZfcUser` with `Laminas\Db`. If you want to use Doctrine ORM/ODM, you should
also check the [doctrine documentation](https://github.com/bjyoungblood/BjyAuthorize/blob/master/docs/doctrine.md).

 1. Ensure that following modules are enabled in your `application.config.php` file in the this order:
@@ -95,7 +95,7 @@ return [
        /* role providers simply provide a list of roles that should be inserted
         * into the Zend\Acl instance. the module comes with two providers, one
         * to specify roles in a config file and one to load roles using a
         * Zend\Db adapter.
         * Laminas\Db adapter.
         */
        'role_providers' => [

+10 −9

composer.lock

deleted100644 → 0
+0 −3975

File deleted.

Preview size limit exceeded, changes collapsed.

+6 −6
Original line number Diff line number Diff line
@@ -14,15 +14,15 @@ return [
        // identity provider service name
        'identity_provider'     => 'BjyAuthorize\Provider\Identity\ZfcUserZendDb',

        // Role providers to be used to load all available roles into Zend\Permissions\Acl\Acl
        // Role providers to be used to load all available roles into Laminas\Permissions\Acl\Acl
        // Keys are the provider service names, values are the options to be passed to the provider
        'role_providers'        => [],

        // Resource providers to be used to load all available resources into Zend\Permissions\Acl\Acl
        // Resource providers to be used to load all available resources into Laminas\Permissions\Acl\Acl
        // Keys are the provider service names, values are the options to be passed to the provider
        'resource_providers'    => [],

        // Rule providers to be used to load all available rules into Zend\Permissions\Acl\Acl
        // Rule providers to be used to load all available rules into Laminas\Permissions\Acl\Acl
        // Keys are the provider service names, values are the options to be passed to the provider
        'rule_providers'        => [],

@@ -35,7 +35,7 @@ return [
        // Template name for the unauthorized strategy
        'template'              => 'error/403',

        // cache options have to be compatible with Zend\Cache\StorageFactory::factory
        // cache options have to be compatible with Laminas\Cache\StorageFactory::factory
        'cache_options'         => [
            'adapter'   => [
                'name' => 'memory',
@@ -82,7 +82,7 @@ return [
            'BjyAuthorize\View\RedirectionStrategy' => 'BjyAuthorize\View\RedirectionStrategy',
        ],
        'aliases'     => [
            'bjyauthorize_zend_db_adapter' => 'Zend\Db\Adapter\Adapter',
            'bjyauthorize_zend_db_adapter' => 'Laminas\Db\Adapter\Adapter',
        ],
        'initializers' => [
            'BjyAuthorize\Service\AuthorizeAwareServiceInitializer'
@@ -110,7 +110,7 @@ return [
        ],
    ],

    'zenddevelopertools' => [
    'laminas-developer-tools' => [
        'profiler' => [
            'collectors' => [
                'bjy_authorize_role_collector' => 'BjyAuthorize\\Collector\\RoleCollector',
+1 −1
Original line number Diff line number Diff line
# Using BjyAuthorize with Doctrine

If you wish to use Doctrine 2 ORM entities (ORM) or MongoDB ODM Documents (ODM), all you will need to do is
having your authentication identity implement either `Zend\Permissions\Acl\Role\RoleInterface` or
having your authentication identity implement either `Laminas\Permissions\Acl\Role\RoleInterface` or
`BjyAuthorize\Provider\Role\ProviderInterface`.

## BjyAuthorize, ZfcUser and ZfcUserDoctrineORM
Loading