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 ...@@ -33,13 +33,12 @@ class PhpManager extends Manager
{ {
/** /**
* @var string the path of the PHP script that contains the authorization data. * @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. * 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 * Make sure this file is writable by the Web server process if the authorization needs to be changed online.
* needs to be changed.
* @see loadFromFile() * @see loadFromFile()
* @see saveToFile() * @see saveToFile()
*/ */
public $authFile; public $authFile = '@app/data/rbac.php';
private $_items = []; // itemName => item private $_items = []; // itemName => item
private $_children = []; // itemName, childName => child private $_children = []; // itemName, childName => child
...@@ -53,9 +52,7 @@ class PhpManager extends Manager ...@@ -53,9 +52,7 @@ class PhpManager extends Manager
public function init() public function init()
{ {
parent::init(); parent::init();
if ($this->authFile === null) { $this->authFile = Yii::getAlias($this->authFile);
$this->authFile = Yii::getAlias('@app/data/rbac') . '.php';
}
$this->load(); $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