Skip to content

Commit

Permalink
use more appropriate array key when passing options to the adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
0x20h committed Jan 13, 2012
1 parent 6ddf6da commit ef5eead
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Controller/Component/Acl/PhpAcl.php
Expand Up @@ -49,8 +49,8 @@ public function __construct() {
* @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');
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php
Expand Up @@ -33,7 +33,7 @@ public function setUp() {
$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',
),
));
Expand Down Expand Up @@ -299,7 +299,7 @@ public function testAroDeclarationContainsCycles() {
*/
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'));
Expand Down

0 comments on commit ef5eead

Please sign in to comment.