Removing action() from AuthComponent, its in the authorization objects now.

Updating tests.
This commit is contained in:
mark_story 2011-01-21 16:25:04 -05:00
parent dc03e4f26c
commit 28ad51c92b
2 changed files with 0 additions and 47 deletions

View file

@ -627,24 +627,6 @@ class AuthComponent extends Component {
return $this->Acl->check($user, $object, $action);
}
/**
* Returns the path to the ACO node bound to a controller/action.
*
* @param string $action Optional. The controller/action path to validate the
* user against. The current request action is used if
* none is specified.
* @return boolean ACO node path
* @link http://book.cakephp.org/view/1256/action
*/
public function action($action = ':plugin/:controller/:action') {
$plugin = empty($this->request['plugin']) ? null : Inflector::camelize($this->request['plugin']) . '/';
return str_replace(
array(':controller', ':action', ':plugin/'),
array(Inflector::camelize($this->request['controller']), $this->request['action'], $plugin),
$this->actionPath . $action
);
}
/**
* Returns a reference to the model object specified, and attempts
* to load it if it is not found.

View file

@ -817,35 +817,6 @@ class AuthTest extends CakeTestCase {
$this->assertFalse($this->Controller->Auth->startup($this->Controller));
}
/**
* test the action() method
*
* @return void
*/
function testActionMethod() {
$this->Controller->request['controller'] = 'auth_test';
$this->Controller->request['action'] = 'add';
$this->Controller->Auth->initialize($this->Controller);
$this->Controller->Auth->actionPath = 'ROOT/';
$result = $this->Controller->Auth->action();
$this->assertEqual($result, 'ROOT/AuthTest/add');
$result = $this->Controller->Auth->action(':controller');
$this->assertEqual($result, 'ROOT/AuthTest');
$result = $this->Controller->Auth->action(':controller');
$this->assertEqual($result, 'ROOT/AuthTest');
$this->Controller->request['plugin'] = 'test_plugin';
$this->Controller->request['controller'] = 'auth_test';
$this->Controller->request['action'] = 'add';
$this->Controller->Auth->initialize($this->Controller);
$result = $this->Controller->Auth->action();
$this->assertEqual($result, 'ROOT/TestPlugin/AuthTest/add');
}
/**
* test that deny() converts camel case inputs to lowercase.
*