GitHub - yiisoft/rbac-php: RBAC PHP file storage.
source link: https://github.com/yiisoft/rbac-php
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Yii RBAC PHP File Storage
This package provides PHP file-based storage for RBAC (Role-Based Access Control) package.
Requirements
- PHP 7.4 or higher.
Installation
The package could be installed with composer:
composer require yiisoft/rbac-php --prefer-dist
See yiisoft/rbac for RBAC package installation instructions.
General usage
The storage is suitable for authorization data that is not too big (for example, the authorization data for a personal blog system) or for fairly static RBAC hierarchy.
Authorization data is stored in three PHP files specified by Storage::$itemFile
, Storage::$assignmentFile
,
and Storage::$ruleFile
.
PHP should be able to read and write these files. Non-existing files will be created automatically on any write operation.
Testing
Unit testing
The package is tested with PHPUnit. To run tests:
./vendor/bin/phpunit
Mutation testing
The package tests are checked with Infection mutation framework with Infection Static Analysis Plugin. To run it:
./vendor/bin/roave-infection-static-analysis-plugin
Static analysis
The code is statically analyzed with Psalm. To run static analysis:
./vendor/bin/psalm
License
The Yii Dependency Injection is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.
Support the project
Follow updates
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK