yiisoft / rbac-php
Yii RBAC PHP File Storage
Fund package maintenance!
Opencollective
yiisoft
Requires
- php: ^7.4|^8.0
- yiisoft/rbac: ^1.0
- yiisoft/var-dumper: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- psr/log: ^1.1.3
- roave/infection-static-analysis-plugin: ^1.18
- spatie/phpunit-watcher: ^1.23
- vimeo/psalm: ^4.22
- yiisoft/files: ^1.0
This package is auto-updated.
Last update: 2023-09-28 08:46:12 UTC
README
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.