Download the PHP package fivelab/authorize-action without Composer
On this page you can find all versions of the php package fivelab/authorize-action. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fivelab/authorize-action
More information about fivelab/authorize-action
Files in fivelab/authorize-action
Package authorize-action
Short Description The library for authorize action before executing.
License MIT
Informations about the package authorize-action
Authorize Action
Add functionality for authorize action before executing.
Requirements
- PHP 7.1 or higher
Installation
Add AuthorizeAction package in your composer.json:
`
Now tell composer to download the library by running the command:
Why?
In many cases, you should check grants before executing command/code. This library add functionality for easy declare the authorize action and verify the action before executing.
Examples:
For start, you should declare the authorize action. The action should implement
FiveLab\Component\AuthorizeAction\Action\AuthorizeActionInterface
:
Secondary, you should declare the verifier for verifying this action. The verifier should implement
FiveLab\Component\AuthorizeAction\Verifier\AuthorizeActionVerifierInterface
:
Attention: the verifier should throw
AccessDeniedException
if the action not verified.
In last step you should create the authorization checker:
Great! After creating the checker you can check right for executing action:
Attention: If the action not verified (not granted) the authorization check throws
AccessDeniedException
.
License
This library is under the MIT license. See the complete license in library
Reporting an issue or a feature request
Issues and feature requests are tracked in the Github issue tracker.
Contributors:
Thanks to everyone participating in the development of this AuthorizeAction library!