https://github.com/dotkernel/dot-controller-plugin-authorization
DotKernel authorization controller plugin component
https://github.com/dotkernel/dot-controller-plugin-authorization
Last synced: 9 months ago
JSON representation
DotKernel authorization controller plugin component
- Host: GitHub
- URL: https://github.com/dotkernel/dot-controller-plugin-authorization
- Owner: dotkernel
- License: mit
- Created: 2016-09-22T19:12:03.000Z (over 9 years ago)
- Default Branch: 2.9-PHP-8.1
- Last Pushed: 2024-03-25T16:57:55.000Z (almost 2 years ago)
- Last Synced: 2025-04-19T09:41:50.561Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
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

[](https://github.com/dotkernel/dot-controller-plugin-authorization/blob/2.0.1/LICENSE.md)

## Installation
Run the following command
```bash
$ 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
```php
$this->authorization()->...
```
This plugin defines one method, as a proxy to the registered authorization service
```php
$this->authorization()->isGranted($permission, array $roles = [], $context = null);
```