Commit 975f263e by Qiang Xue

Fixes #1356: Alias for authFile in rbac/PhpManager not resolved

parent 323008b1
......@@ -33,13 +33,12 @@ class PhpManager extends Manager
{
/**
* @var string the path of the PHP script that contains the authorization data.
* If not set, it will be using 'protected/data/rbac.php' as the data file.
* Make sure this file is writable by the Web server process if the authorization
* needs to be changed.
* This can be either a file path or a path alias to the file.
* Make sure this file is writable by the Web server process if the authorization needs to be changed online.
* @see loadFromFile()
* @see saveToFile()
*/
public $authFile;
public $authFile = '@app/data/rbac.php';
private $_items = []; // itemName => item
private $_children = []; // itemName, childName => child
......@@ -53,9 +52,7 @@ class PhpManager extends Manager
public function init()
{
parent::init();
if ($this->authFile === null) {
$this->authFile = Yii::getAlias('@app/data/rbac') . '.php';
}
$this->authFile = Yii::getAlias($this->authFile);
$this->load();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment