setAction('edit', 'Headed to edit "%categoryTitle%" Category'); $this->setAction('update', 'Updated "%categoryTitle%" Category'); $this->setActionCallback('edit', [$this, 'isEnabledEditAction']); return parent::_init(); } public function isEnabledEditAction() { if (false === ($lastRecord = $this->_getLastRoleRecord())) { return true; } return !( $this->_controller == $lastRecord['controller'] && 'update' == $lastRecord['action'] && $this->_objectId == $lastRecord['objectId'] ); } }