Droped support to deny('*').

This commit is contained in:
Daniel Pakuschewski 2011-10-29 13:54:35 -02:00
parent 8738ef3dc2
commit 09579198a9
2 changed files with 13 additions and 3 deletions

View file

@ -452,7 +452,8 @@ class AuthComponent extends Component {
* You can use deny with either an array, or var args.
*
* `$this->Auth->deny(array('edit', 'add'));` or
* `$this->Auth->deny('edit', 'add');`
* `$this->Auth->deny('edit', 'add');` or
* `$this->Auth->deny();` to remove all items from the allowed list
*
* @param mixed $action,... Controller action name or array of actions
* @return void
@ -461,7 +462,7 @@ class AuthComponent extends Component {
*/
public function deny($action = null) {
$args = func_get_args();
if(empty($args) || $args == array('*')){
if(empty($args)){
$this->allowedActions = array();
}else{
if (isset($args[0]) && is_array($args[0])) {

View file

@ -638,7 +638,7 @@ class AuthComponentTest extends CakeTestCase {
$this->assertFalse($this->Controller->Auth->startup($this->Controller));
$this->Controller->Auth->allow('*');
$this->Controller->Auth->deny('*');
$this->Controller->Auth->deny();
$this->Controller->request['action'] = 'camelCase';
$this->assertFalse($this->Controller->Auth->startup($this->Controller));
@ -655,6 +655,15 @@ class AuthComponentTest extends CakeTestCase {
$this->Controller->request['action'] = 'login';
$this->assertFalse($this->Controller->Auth->startup($this->Controller));
$this->Controller->Auth->allow();
$this->Controller->Auth->deny('*');
$this->Controller->request['action'] = 'camelCase';
$this->assertTrue($this->Controller->Auth->startup($this->Controller));
$this->Controller->request['action'] = 'login';
$this->assertTrue($this->Controller->Auth->startup($this->Controller));
}
/**