mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-22 09:40:41 +08:00
- Data is now stored in three separate files for items, assignments and rules. File format is simpler. - Removed `authFile`. Added `itemsFile`, `assignmentsFile` and `rulesFile`. - `createdAt` and `updatedAt` are now properly filled with corresponding file modification time. - `save()` and `load()` are now protected instead of public. - Added unit test for saving and loading data.
37 lines
703 B
PHP
37 lines
703 B
PHP
<?php
|
|
namespace yiiunit\framework\rbac;
|
|
|
|
use yii\rbac\PhpManager;
|
|
|
|
/**
|
|
* Exposes protected properties and methods to inspect from outside
|
|
*/
|
|
class ExposedPhpManager extends PhpManager
|
|
{
|
|
/**
|
|
* @var \yii\rbac\Item[]
|
|
*/
|
|
public $items = []; // itemName => item
|
|
/**
|
|
* @var array
|
|
*/
|
|
public $children = []; // itemName, childName => child
|
|
/**
|
|
* @var \yii\rbac\Assignment[]
|
|
*/
|
|
public $assignments = []; // userId, itemName => assignment
|
|
/**
|
|
* @var \yii\rbac\Rule[]
|
|
*/
|
|
public $rules = []; // ruleName => rule
|
|
|
|
public function load()
|
|
{
|
|
parent::load();
|
|
}
|
|
|
|
public function save()
|
|
{
|
|
parent::save();
|
|
}
|
|
} |