diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 8bd4dd4d5d2..deef4bc7172 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -431,7 +431,7 @@ public function constructAuthorize() { * @return void * @link http://book.cakephp.org/view/1257/allow */ - public function allow($action) { + public function allow($action = null) { $args = func_get_args(); if (empty($args) || $args == array('*')) { $this->allowedActions = $this->_methods; @@ -456,7 +456,7 @@ public function allow($action) { * @see AuthComponent::allow() * @link http://book.cakephp.org/view/1258/deny */ - public function deny($action) { + public function deny($action = null) { $args = func_get_args(); if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; diff --git a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php index 80a4fe1e53e..d31db84dc1b 100644 --- a/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php @@ -606,7 +606,7 @@ public function testAllConfigWithAuthenticate() { public function testAllowDenyAll() { $this->Controller->Auth->initialize($this->Controller); - $this->Controller->Auth->allow('*'); + $this->Controller->Auth->allow(); $this->Controller->Auth->deny('add', 'camelCase'); $this->Controller->request['action'] = 'delete'; @@ -621,6 +621,9 @@ public function testAllowDenyAll() { $this->Controller->Auth->allow('*'); $this->Controller->Auth->deny(array('add', 'camelCase')); + $this->Controller->request['action'] = 'delete'; + $this->assertTrue($this->Controller->Auth->startup($this->Controller)); + $this->Controller->request['action'] = 'camelCase'; $this->assertFalse($this->Controller->Auth->startup($this->Controller)); }