Cake\Controller\Component\AuthComponent::deny PHP Method

deny() public method

You can use deny with either an array or a simple string. $this->Auth->deny('view'); $this->Auth->deny(['edit', 'add']); or $this->Auth->deny(); to remove all items from the allowed list
public deny ( string | array | null $actions = null ) : void
$actions string | array | null Controller action name or array of actions
return void
    public function deny($actions = null)
    {
        if ($actions === null) {
            $this->allowedActions = [];
            return;
        }
        foreach ((array) $actions as $action) {
            $i = array_search($action, $this->allowedActions);
            if (is_int($i)) {
                unset($this->allowedActions[$i]);
            }
        }
        $this->allowedActions = array_values($this->allowedActions);
    }