Download the PHP package klsoft/yii3-authz without Composer
On this page you can find all versions of the php package klsoft/yii3-authz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download klsoft/yii3-authz
More information about klsoft/yii3-authz
Files in klsoft/yii3-authz
Package yii3-authz
Short Description The package provides Yii 3 authorization middleware that uses Yii RBAC
License MIT
Homepage https://github.com/klsoft-web/yii3-authz
Informations about the package yii3-authz
YII3-AUTHZ
The package provides Yii 3 authorization middleware that uses Yii RBAC. It is intended for use with web applications. For authorization of a RESTful web service, use the YII3-KEYCLOAK-AUTHZ package instead.
Requirement
- PHP 8.1 or higher.
Installation
How to use
1. Configure Authentication
Example:
2. Configure RBAC
3. Add the forbidden URL to param.php
Example:
4. Configure Authorization
Example:
5. Apply permissions.
5.1. To an action.
First, add Authorization to a route:
Or to a group of routes:
Then, apply permissions to an action:
Example of an OR permission:
Example of a permission with an executing parameter value that would be passed to the rules associated with the roles:
5.2. To a route.
First, define the set of permissions:
Then, you can apply this set to a route:
All versions of yii3-authz with dependencies
psr/http-factory Version ^1.0
psr/http-message Version ^1.0 || ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/container Version ^1.0 || ^2.0
yiisoft/http Version ^1.2
yiisoft/router Version ^4
yiisoft/user Version ^2.3.1
yiisoft/rbac Version ^2.1.0