Download the PHP package bjyoungblood/bjy-authorize without Composer
On this page you can find all versions of the php package bjyoungblood/bjy-authorize. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bjyoungblood/bjy-authorize
More information about bjyoungblood/bjy-authorize
Files in bjyoungblood/bjy-authorize
Package bjy-authorize
Short Description Zend\Acl based firewall system for ZF2 dispatch protection
License BSD-3-Clause
Homepage https://github.com/bjyoungblood/BjyAuthorize
Informations about the package bjy-authorize
BjyAuthorize - Acl security for ZF2
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.
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?
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:
And here's how it would look like with BjyAuthorize enabled:
Requirements
- Zend Framework 2
- ZfcUser (optional)
- ZfcUserDoctrineORM (optional)
Installation
Composer
The suggested installation method is via composer:
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.
- Ensure that following modules are enabled in your
application.config.php
file in the this order:ZfcBase
ZfcUser
BjyAuthorize
- Import the SQL schema located in
./vendor/BjyAuthorize/data/schema.sql
. - 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:
Helpers and Plugins
There are view helpers and controller plugins registered for this module. In either a controller or a view script, you can call , which will query the ACL using the currently authenticated (or default) user's roles.
Whenever you need to stop processing your action you can throw an UnAuthorizedException and users will see you message on a 403 page.
License
Released under the MIT License. See file LICENSE included with the source code for this project for a copy of the licensing terms.
All versions of bjy-authorize with dependencies
zendframework/zend-permissions-acl Version ~2.1
zendframework/zend-mvc Version ~2.1
zendframework/zend-eventmanager Version ~2.1
zendframework/zend-servicemanager Version ~2.1
zendframework/zend-http Version ~2.1
zendframework/zend-view Version ~2.1
zendframework/zend-cache Version ~2.1