Adding support for userPath in IniAcl.

Test case added.
Fixes #1291
This commit is contained in:
Mark Story 2010-11-28 21:22:10 -05:00
parent 2495b3cd4c
commit 40585a34e8
2 changed files with 31 additions and 0 deletions

View file

@ -538,6 +538,15 @@ class IniAcl extends Object implements AclInterface {
*/
public $config = null;
/**
* The Set::classicExtract() path to the user/aro identifier in the
* acl.ini file. This path will be used to extract the string
* representation of a user used in the ini file.
*
* @var string
*/
public $userPath = 'User.username';
/**
* Initialize method
*
@ -599,6 +608,10 @@ class IniAcl extends Object implements AclInterface {
$this->config = $this->readConfigFile(CONFIGS . 'acl.ini.php');
}
$aclConfig = $this->config;
if (is_array($aro)) {
$aro = Set::classicExtract($aro, $this->userPath);
}
if (isset($aclConfig[$aro]['deny'])) {
$userDenies = $this->arrayTrim(explode(",", $aclConfig[$aro]['deny']));