diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 19d93054531..0ed374f6b8c 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -591,7 +591,7 @@ function __authType($auth = null) { * Takes a list of actions in the current controller for which authentication is not required, or * no parameters to allow all actions. * - * @param string $action Controller action name + * @param mixed $action Controller action name or array of actions * @param string $action Controller action name * @param string ... etc. * @return void @@ -612,7 +612,7 @@ function allow() { /** * Removes items from the list of allowed actions. * - * @param string $action Controller action name + * @param mixed $action Controller action name or array of actions * @param string $action Controller action name * @param string ... etc. * @return void @@ -621,6 +621,9 @@ function allow() { */ function deny() { $args = func_get_args(); + if (isset($args[0]) && is_array($args[0])) { + $args = $args[0]; + } foreach ($args as $arg) { $i = array_search($arg, $this->allowedActions); if (is_int($i)) { diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 34ddb2955e2..e6b75a5cf32 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -777,7 +777,7 @@ function testAllowDenyAll() { $this->Controller->Auth->initialize($this->Controller); $this->Controller->Auth->allow('*'); - $this->Controller->Auth->deny('add'); + $this->Controller->Auth->deny('add', 'camelcase'); $this->Controller->params['action'] = 'delete'; $this->assertTrue($this->Controller->Auth->startup($this->Controller)); @@ -787,6 +787,15 @@ function testAllowDenyAll() { $this->Controller->params['action'] = 'Add'; $this->assertFalse($this->Controller->Auth->startup($this->Controller)); + + $this->Controller->params['action'] = 'camelCase'; + $this->assertFalse($this->Controller->Auth->startup($this->Controller)); + + $this->Controller->Auth->allow('*'); + $this->Controller->Auth->deny(array('add', 'camelcase')); + + $this->Controller->params['action'] = 'camelCase'; + $this->assertFalse($this->Controller->Auth->startup($this->Controller)); } /**