Permalink
Browse files

Droped support to deny('*').

  • Loading branch information...
1 parent 8738ef3 commit 09579198a94422ea0195f662f52c409e317e2e21 Daniel Pakuschewski committed Oct 29, 2011
@@ -452,7 +452,8 @@ public function allow($action = null) {
* 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 @@ public function allow($action = null) {
*/
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])) {
@@ -638,7 +638,7 @@ public function testAllowDenyAll() {
$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 @@ public function testAllowDenyAll() {
$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));
+
}
/**

0 comments on commit 0957919

Please sign in to comment.