mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Allow AuthComponent to deny all actions with single deny() or deny('*')
This commit is contained in:
parent
1244656595
commit
5246e7dd1d
1 changed files with 12 additions and 8 deletions
|
@ -461,6 +461,9 @@ class AuthComponent extends Component {
|
||||||
*/
|
*/
|
||||||
public function deny($action = null) {
|
public function deny($action = null) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
if(empty($args) || $args == array('*')){
|
||||||
|
$this->allowedActions = array();
|
||||||
|
}else{
|
||||||
if (isset($args[0]) && is_array($args[0])) {
|
if (isset($args[0]) && is_array($args[0])) {
|
||||||
$args = $args[0];
|
$args = $args[0];
|
||||||
}
|
}
|
||||||
|
@ -472,6 +475,7 @@ class AuthComponent extends Component {
|
||||||
}
|
}
|
||||||
$this->allowedActions = array_values($this->allowedActions);
|
$this->allowedActions = array_values($this->allowedActions);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps action names to CRUD operations. Used for controller-based authentication. Make sure
|
* Maps action names to CRUD operations. Used for controller-based authentication. Make sure
|
||||||
|
|
Loading…
Add table
Reference in a new issue