diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 697d31815..0b5aea1d6 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -432,7 +432,7 @@ class AuthComponent extends Component { */ public function allow($action = null) { $args = func_get_args(); - if (empty($args)) { + if (empty($args) || $action === null) { $this->allowedActions = $this->_methods; } else { if (isset($args[0]) && is_array($args[0])) { @@ -458,7 +458,7 @@ class AuthComponent extends Component { */ public function deny($action = null) { $args = func_get_args(); - if (empty($args)) { + if (empty($args) || $action === null) { $this->allowedActions = array(); } else { if (isset($args[0]) && is_array($args[0])) { diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index 486bf88a9..f80e8ff81 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -654,6 +654,18 @@ class AuthComponentTest extends CakeTestCase { $this->Controller->request['action'] = 'login'; $this->assertFalse($this->Controller->Auth->startup($this->Controller)); + + $this->Controller->Auth->deny(); + $this->Controller->Auth->allow(null); + + $this->Controller->request['action'] = 'camelCase'; + $this->assertTrue($this->Controller->Auth->startup($this->Controller)); + + $this->Controller->Auth->allow(); + $this->Controller->Auth->deny(null); + + $this->Controller->request['action'] = 'camelCase'; + $this->assertFalse($this->Controller->Auth->startup($this->Controller)); } /**