Download the PHP package nybbl/access-acl without Composer
On this page you can find all versions of the php package nybbl/access-acl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nybbl/access-acl
More information about nybbl/access-acl
Files in nybbl/access-acl
Package access-acl
Short Description Provides an easy zf3 acl implementation.
License BSD-3-Clause
Informations about the package access-acl
Nybbl Access ACL
An easy to use ACL implementation for ZF3. Provides support for Doctrine out of the box.
Installation
Usage
To use this module, add it to your modules.config.php file:
Optional Config
If you want to further configure the module, copy the contents of this package's config/module.config.php into config/autoload/nybbl.access.acl.config.php or into your config/autoload/global.php file.
Config key descriptions:
-
redirect_route_name: The route name where the application should redirect. For example, you might want unauthorised users to be redirect to "user.login".
- default_access_all_role: The default role. If there's no identity in the AuthenticationService, then the default role is "Guest".
Mapping Resources
The core of an ACL is a resource. To map your resources (aka controllers), you can specify an array key in your module configs.
Application/config/module.config.php:
Customising the not-authorised view
By default, the "not-authorised" view just renders some text. You most likely want to customise this. You can create a view directory in any module with the path:
Changing Role Providers
To change your role provider, you'll need a class that implements the RoleProviderInterface. Then add the alias to the interface in your module config:
Creating Roles
To create a role, you'll need to create a class that implements the Nybbl\AccessAcl\Contract\RoleInterface
Like so:
Your custom role provider can then consume these roles.
Creating Dynamic Assertions
In your controller:
By default, a dynamic assertion will return false.
All versions of access-acl with dependencies
zendframework/zend-permissions-acl Version ^2.7
zendframework/zend-session Version ^2.7.1
zendframework/zend-authentication Version ^2.6
zendframework/zend-servicemanager Version ^3.3
zendframework/zend-mvc Version ^3.1@dev