Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed the allow method to parameters not be required.

  • Loading branch information...
commit 840d27bbb9e20259b001d6e636fecf091e82dcd0 1 parent 6612cb3
@jrbasso jrbasso authored
View
4 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];
View
5 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));
}
Please sign in to comment.
Something went wrong with that request. Please try again.