Download the PHP package kokspflanze/bjy-authorize without Composer
On this page you can find all versions of the php package kokspflanze/bjy-authorize. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kokspflanze/bjy-authorize
More information about kokspflanze/bjy-authorize
Files in kokspflanze/bjy-authorize
Package bjy-authorize
Short Description Laminas\Acl based firewall system for Laminas dispatch protection
License BSD-3-Clause
Homepage https://github.com/kokspflanze/BjyAuthorize
Informations about the package bjy-authorize
BjyAuthorize - Acl security for Laminas
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
This is a fork of the original 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 or open a PullRequest.
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:
And here's how it would look like with BjyAuthorize enabled:
Requirements
Installation
Composer
The suggested installation method is via composer:
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.
- Ensure that following modules are enabled in your
application.config.php
file in the this order:LmcUser
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
laminas/laminas-permissions-acl Version ^2.8.0
laminas/laminas-mvc Version ^3.2.0
laminas/laminas-eventmanager Version ^3.4.0
laminas/laminas-servicemanager Version ^3.7.0
laminas/laminas-http Version ^2.15.0
laminas/laminas-view Version ^2.14.2
laminas/laminas-authentication Version ^2.8.0
laminas/laminas-cache Version ^2.13.2 || ^3.1.0