Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed documentation to methods that use func_get_args().
- Loading branch information
Showing
4 changed files
with
9 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -427,13 +427,11 @@ public function constructAuthorize() { | |
* | ||
* `$this->Auth->allow('*');` | ||
* | ||
* @param mixed $action Controller action name or array of actions | ||
* @param string $action Controller action name | ||
* @param string ... etc. | ||
* @param mixed $action,... Controller action name or array of actions | ||
* @return void | ||
* @link http://book.cakephp.org/view/1257/allow | ||
*/ | ||
public function allow() { | ||
public function allow($action) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ADmad
Member
|
||
$args = func_get_args(); | ||
if (empty($args) || $args == array('*')) { | ||
$this->allowedActions = $this->_methods; | ||
|
@@ -453,14 +451,12 @@ public function allow() { | |
* `$this->Auth->deny(array('edit', 'add'));` or | ||
* `$this->Auth->deny('edit', 'add');` | ||
* | ||
* @param mixed $action Controller action name or array of actions | ||
* @param string $action Controller action name | ||
* @param string ... etc. | ||
* @param mixed $action,... Controller action name or array of actions | ||
* @return void | ||
* @see AuthComponent::allow() | ||
* @link http://book.cakephp.org/view/1258/deny | ||
*/ | ||
public function deny() { | ||
public function deny($action) { | ||
$args = func_get_args(); | ||
if (isset($args[0]) && is_array($args[0])) { | ||
$args = $args[0]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defining $action as param, makes it required, while you should be abe to call just allow() without arguments:
if (empty($args) || $args == array('*')) {
it will allow all methods, i dont know why the test passes for this, will check why it doesnt fail here