PHPackages                             kokspflanze/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. kokspflanze/bjy-authorize

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

kokspflanze/bjy-authorize
=========================

Laminas\\Acl based firewall system for Laminas dispatch protection

2.4.3(2y ago)20178.2k↑13.4%19[3 issues](https://github.com/kokspflanze/BjyAuthorize/issues)[1 PRs](https://github.com/kokspflanze/BjyAuthorize/pulls)4BSD-3-ClausePHPPHP ^7.3 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0CI failing

Since Dec 19Pushed 2mo ago4 watchersCompare

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

READMEChangelog (10)Dependencies (15)Versions (33)Used By (4)

BjyAuthorize - Acl security for Laminas
=======================================

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

[![Continuous Integration](https://github.com/kokspflanze/BjyAuthorize/actions/workflows/continous-integration.yml/badge.svg)](https://github.com/kokspflanze/BjyAuthorize/actions/workflows/continous-integration.yml)[![Total Downloads](https://camo.githubusercontent.com/138f38aee7e0c3ce1961c6490c08f120492f2f03b5907afe209951aaf891c1df/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6b7370666c616e7a652f626a792d617574686f72697a652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/kokspflanze/bjy-authorize)[![Latest Stable Version](https://camo.githubusercontent.com/654c1e7aa9e9aca1ca938991bbbb302aeacf99d23a29d18177c77c20b3c78740/68747470733a2f2f706f7365722e707567782e6f72672f6b6f6b7370666c616e7a652f626a792d617574686f72697a652f762f737461626c652e706e67)](https://packagist.org/packages/kokspflanze/bjy-authorize)

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 `Laminas\Db` or Doctrine ORM/ODM.

Information
-----------

[](#information)

This is a fork of the original [bjyoungblood/BjyAuthorize](https://github.com/bjyoungblood/BjyAuthorize) module. I added Laminas support, so starting with release 2.0.0 the module works with Laminas. Releases from the 1.x series are still targeted at Zend Framework 2 and 3. If you found a bug, please report it, just pm me in [gitter](https://gitter.im/kokspflanze) or open a PullRequest.

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 `Laminas\Mvc` application workflow would look like:

[![Laminas 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:

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

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

[](#requirements)

- [Laminas](https://getlaminas.org/)
- [LmcUser](https://github.com/LM-Commons/LmcUser) (optional)

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

[](#installation)

### Composer

[](#composer)

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

```
composer require kokspflanze/bjy-authorize
```

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

[](#configuration)

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

1. Ensure that following modules are enabled in your `application.config.php` file in the this order:
    - `LmcUser`
    - `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:

```
