/** * {@inheritDoc} */ protected function runAjaxHandler($handler) { if ($handler == 'onSave' && !$this->can($this->action) || ($handler == 'onDelete' || $this->action == 'delete') && !$this->can('delete')) { return $this->notAllowed(true); } return parent::runAjaxHandler($handler); }