mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
use more appropriate array key when passing options to the adapter
This commit is contained in:
parent
6ddf6dad36
commit
ef5eead038
2 changed files with 4 additions and 4 deletions
|
@ -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');
|
||||
|
|
|
@ -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'));
|
||||
|
|
Loading…
Add table
Reference in a new issue