dotkernel / dot-controller-plugin-authorization
DotKernel authorization controller plugin
Installs: 1 858
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0
- dotkernel/dot-authorization: ^3.4.0
- dotkernel/dot-controller: ^3.4.0
- laminas/laminas-servicemanager: ^3.21.0
Requires (Dev)
- phpunit/phpunit: ^10.3.2
- squizlabs/php_codesniffer: ^3.7
README
Caution
Security-Only Maintenance Mode
This package is considered feature-complete, and is now in security-only maintenance mode.
dot-controller-plugin-authorization
Authorization controller plugin
Installation
Run the following command
$ composer require dotkernel/dot-controller-plugin-authorization
This will also install packages dotkernel/dot-controller
and dotkernel/dot-authorization
as dependencies.
Next, enable the module by merging the ConfigProvider
to your application's configuration.
Usage
In any controller, you can access this plugin by calling
$this->authorization()->...
This plugin defines one method, as a proxy to the registered authorization service
$this->authorization()->isGranted($permission, array $roles = [], $context = null);