PHPackages                             bjyoungblood/bjy-authorize - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. bjyoungblood/bjy-authorize

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

bjyoungblood/bjy-authorize
==========================

Zend\\Acl based firewall system for ZF2 dispatch protection

1.4.0(12y ago)272780.0k↓25.6%16010BSD-3-ClausePHPPHP &gt;=5.3.3

Since Dec 19Pushed 8y ago42 watchersCompare

[ Source](https://github.com/bjyoungblood/BjyAuthorize)[ Packagist](https://packagist.org/packages/bjyoungblood/bjy-authorize)[ Docs](https://github.com/bjyoungblood/BjyAuthorize)[ RSS](/packages/bjyoungblood-bjy-authorize/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (17)Used By (10)

BjyAuthorize - Acl security for ZF2
===================================

[](#bjyauthorize---acl-security-for-zf2)

Deprecated
----------

[](#deprecated)

This package is now officially deprecated and will not receive any future updates or bug fixes.

As long-term support for Zend Framework 2 ended on 2018-03-31, any users who currently rely on this package are heavily encouraged to migrate to Zend Framework 3 or another framework.

---

[![Build Status](https://camo.githubusercontent.com/9f45f5af83737fe20dbc6b089f201cd038e7393e2dbeff2bae768d2e9437b6d2/68747470733a2f2f7472617669732d63692e6f72672f626a796f756e67626c6f6f642f426a79417574686f72697a652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/bjyoungblood/BjyAuthorize)[![Coverage Status](https://camo.githubusercontent.com/49af73bb9f022d9f7b88ecac5bf50713732d521a09068dd3994dfba4c959a069/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f626a796f756e67626c6f6f642f426a79417574686f72697a652f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/bjyoungblood/BjyAuthorize)[![Total Downloads](https://camo.githubusercontent.com/e9126e5ec812fd7b746ba1582739e1860662d8907a3a1078b5cb1fe2c32391ad/68747470733a2f2f706f7365722e707567782e6f72672f626a796f756e67626c6f6f642f626a792d617574686f72697a652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/bjyoungblood/bjy-authorize)[![Latest Stable Version](https://camo.githubusercontent.com/86e271248697ff2b00ac16166c5d85a2e253da508726dfc11775e31df7a77c91/68747470733a2f2f706f7365722e707567782e6f72672f626a796f756e67626c6f6f642f626a792d617574686f72697a652f762f737461626c652e706e67)](https://packagist.org/packages/bjyoungblood/bjy-authorize)[![Latest Unstable Version](https://camo.githubusercontent.com/8dddfae94ced2fbceef994b8b351631e389e4f510dee503405da1c7b89f30e6e/68747470733a2f2f706f7365722e707567782e6f72672f626a796f756e67626c6f6f642f626a792d617574686f72697a652f762f756e737461626c652e706e67)](https://packagist.org/packages/bjyoungblood/bjy-authorize)[![Dependency Status](https://camo.githubusercontent.com/0bf31345fdc48f48b8b2f1680798d6ba2d48a7fc53010a241c9fb67867a4667f/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7061636b6167652f7068702d2d626a796f756e67626c6f6f642d2d626a792d617574686f72697a652f62616467652e706e67)](https://www.versioneye.com/package/php--bjyoungblood--bjy-authorize)

This module is designed to provide a facade for `Zend\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).

What does BjyAuthorize do?
--------------------------

[](#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:

[![Zend Mvc Application workflow](https://camo.githubusercontent.com/ee9e8e58711d21ae985cd2af70ef9a78a9628b798123a547e10c27e76fce7ac4/687474703a2f2f79756d6c2e6d652f6469616772616d2f706c61696e3b2f61637469766974792f25323873746172742532392d253345253238726f757465253239253243253230253238726f7574652532392d253345253238676574253230636f6e74726f6c6c6572253239253243253230253238676574253230636f6e74726f6c6c65722532392d253345253238646973706174636825323925324325323025323864697370617463682532392d253345253238656e64253239)](https://camo.githubusercontent.com/ee9e8e58711d21ae985cd2af70ef9a78a9628b798123a547e10c27e76fce7ac4/687474703a2f2f79756d6c2e6d652f6469616772616d2f706c61696e3b2f61637469766974792f25323873746172742532392d253345253238726f757465253239253243253230253238726f7574652532392d253345253238676574253230636f6e74726f6c6c6572253239253243253230253238676574253230636f6e74726f6c6c65722532392d253345253238646973706174636825323925324325323025323864697370617463682532392d253345253238656e64253239)

And here's how it would look like with BjyAuthorize enabled:

[![Zend Mvc Application workflow with BjyAuthorize](https://camo.githubusercontent.com/f41d0270ad0e6b4b98b4c77655ae4ee41b4b73d1e2662759099b9f274fee81de/687474703a2f2f79756d6c2e6d652f6469616772616d2f706c61696e3b2f61637469766974792f25323873746172742532392d253345253238726f757465253239253243253230253238726f7574652532392d253345253343612533452d6e6f253230726f7574652532306775617264253345253238676574253230636f6e74726f6c6c6572253239253243253230253343612533452d253345253238726f7574652532306775617264253239253243253230253238726f75746525323067756172642532392d253345253343622533452d617574686f72697a6564253345253238676574253230636f6e74726f6c6c657225323925324325323025334362253345756e617574686f72697a65642d2533452532386572726f72253239253243253230253238676574253230636f6e74726f6c6c65722532392d253345253343632533452d6e6f253230636f6e74726f6c6c657225323067756172642533452532386469737061746368253239253243253230253343632533452d253345253238636f6e74726f6c6c65722532306775617264253239253243253230253238636f6e74726f6c6c657225323067756172642532392d253345253343642533452d617574686f72697a6564253345253238646973706174636825323925324325323025334364253345756e617574686f72697a65642d2533452532386572726f722532392532432532302532386572726f722532392d253345253238656e6425323925324325323025323864697370617463682532392d253345253238656e64253239)](https://camo.githubusercontent.com/f41d0270ad0e6b4b98b4c77655ae4ee41b4b73d1e2662759099b9f274fee81de/687474703a2f2f79756d6c2e6d652f6469616772616d2f706c61696e3b2f61637469766974792f25323873746172742532392d253345253238726f757465253239253243253230253238726f7574652532392d253345253343612533452d6e6f253230726f7574652532306775617264253345253238676574253230636f6e74726f6c6c6572253239253243253230253343612533452d253345253238726f7574652532306775617264253239253243253230253238726f75746525323067756172642532392d253345253343622533452d617574686f72697a6564253345253238676574253230636f6e74726f6c6c657225323925324325323025334362253345756e617574686f72697a65642d2533452532386572726f72253239253243253230253238676574253230636f6e74726f6c6c65722532392d253345253343632533452d6e6f253230636f6e74726f6c6c657225323067756172642533452532386469737061746368253239253243253230253343632533452d253345253238636f6e74726f6c6c65722532306775617264253239253243253230253238636f6e74726f6c6c657225323067756172642532392d253345253343642533452d617574686f72697a6564253345253238646973706174636825323925324325323025334364253345756e617574686f72697a65642d2533452532386572726f722532392532432532302532386572726f722532392d253345253238656e6425323925324325323025323864697370617463682532392d253345253238656e64253239)

Requirements
------------

[](#requirements)

- [Zend Framework 2](https://github.com/zendframework/zf2)
- [ZfcUser](https://github.com/ZF-Commons/ZfcUser) (optional)
- [ZfcUserDoctrineORM](https://github.com/ZF-Commons/ZfcUserDoctrineORM) (optional)

Installation
------------

[](#installation)

### Composer

[](#composer)

The suggested installation method is via [composer](http://getcomposer.org/):

```
php composer.phar require bjyoungblood/bjy-authorize:1.4.*
php composer.phar require zf-commons/zfc-user:0.1.*
```

Configuration
-------------

[](#configuration)

Following steps apply if you want to use `ZfcUser` with `Zend\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:
    - `ZfcBase`
    - `ZfcUser`
    - `BjyAuthorize`
2. Import the SQL schema located in `./vendor/BjyAuthorize/data/schema.sql`.
3. Create a `./config/autoload/bjyauthorize.global.php` file and fill it with configuration variable values as described in the following annotated example.

Here is an annotated sample configuration file:

```
