use more appropriate array key when passing options to the adapter

This commit is contained in:
0x20h 2012-01-13 21:55:47 +01:00
parent 6ddf6dad36
commit ef5eead038
2 changed files with 4 additions and 4 deletions

View file

@ -49,8 +49,8 @@ class PhpAcl extends Object implements AclInterface {
* @return void
*/
public function initialize($Component) {
if (!empty($Component->settings['ini_acl'])) {
$this->options = array_merge($this->options, $Component->settings['ini_acl']);
if (!empty($Component->settings['adapter'])) {
$this->options = array_merge($this->options, $Component->settings['adapter']);
}
App::uses('PhpReader', 'Configure');

View file

@ -33,7 +33,7 @@ class PhpAclTest extends CakeTestCase {
$Collection = new ComponentCollection();
$this->PhpAcl = new PhpAcl();
$this->Acl = new AclComponent($Collection, array(
'ini_acl' => array(
'adapter' => array(
'config' => CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.php',
),
));
@ -299,7 +299,7 @@ class PhpAclTest extends CakeTestCase {
*/
public function testPolicy() {
// allow by default
$this->Acl->settings['ini_acl']['policy'] = PhpAcl::ALLOW;
$this->Acl->settings['adapter']['policy'] = PhpAcl::ALLOW;
$this->PhpAcl->initialize($this->Acl);
$this->assertTrue($this->Acl->check('Role/sales', 'foo'));